WindowServer: Show directional cursors when resizing windows.

This commit is contained in:
Andreas Kling 2019-03-31 22:27:37 +02:00
parent 90b2723e7a
commit c992534f73
2 changed files with 25 additions and 1 deletions

View file

@ -1275,3 +1275,27 @@ void WSWindowManager::notify_client_changed_app_menubar(WSClientConnection& clie
set_current_menubar(client.app_menubar());
invalidate(menubar_rect());
}
const WSCursor& WSWindowManager::active_cursor() const
{
if (m_resize_window) {
switch (m_resize_direction) {
case ResizeDirection::Up:
case ResizeDirection::Down:
return *m_resize_vertically_cursor;
case ResizeDirection::Left:
case ResizeDirection::Right:
return *m_resize_horizontally_cursor;
case ResizeDirection::UpLeft:
case ResizeDirection::DownRight:
return *m_resize_diagonally_tlbr_cursor;
case ResizeDirection::UpRight:
case ResizeDirection::DownLeft:
return *m_resize_diagonally_bltr_cursor;
case ResizeDirection::None:
ASSERT_NOT_REACHED();
}
}
return *m_arrow_cursor;
}

View file

@ -84,7 +84,7 @@ public:
bool set_wallpaper(const String& path);
String wallpaper_path() const { return m_wallpaper_path; }
const WSCursor& active_cursor() const { return *m_arrow_cursor; }
const WSCursor& active_cursor() const;
Rect current_cursor_rect() const;
private: