Skip to content

Commit

Permalink
ui/Window: add method GetPosition()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 11, 2024
1 parent 8a877d9 commit 9822781
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ui/Window.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ struct Window {

explicit constexpr Window(WINDOW *_w) noexcept:w(_w) {}

/**
* @return the position of this window on the screen
*/
[[gnu::pure]]
const Point GetPosition() const noexcept {
Point p;
getbegyx(w, p.y, p.x);
return p;
}

[[gnu::pure]]
const Size GetSize() const noexcept {
Size size;
Expand Down

0 comments on commit 9822781

Please sign in to comment.