]> git.mdlowis.com Git - proto/labwc.git/commit
cursor: Factor out cursor_update_common() and fix some glitches
authorJohn Lindgren <john@jlindgren.net>
Mon, 12 Sep 2022 17:14:18 +0000 (13:14 -0400)
committerJohn Lindgren <john@jlindgren.net>
Tue, 13 Sep 2022 17:29:36 +0000 (13:29 -0400)
commit6c6e406507bfb0e9a809b74029b5b05b5a095768
treea42f709a9fd6da25142691050820ba60500983e8
parent4ba59f707458b985cf6b09d0191b26cdf24b7f24
cursor: Factor out cursor_update_common() and fix some glitches

Fix a couple of glitches seen when exiting interactive move/resize:

 - Cursor briefly set to left_ptr rather than the correct cursor image
 - Cursor not updated if the view being moved/resized is destroyed

Also make sure to exit interactive mode if the view is going fullscreen
(labwc gets very confused otherwise).

Code changes in detail:

 - Factor out set_server_cursor() which will set the correct cursor
   image for non-client areas (either XCURSOR_DEFAULT or one of the
   resize cursors).
 - Unify the logic from cursor_rebase() and process_cursor_motion by
   factoring out cursor_update_common().  This corrects some logic
   discrepancies between the two, which should be a good thing(TM).
 - Remove the extra cursor_set(XCURSOR_DEFAULT) from interactive_end()
   and instead rely on cursor_update_focus() to do the right thing.
 - Simplify cursor_button() by just calling interactive_end() when we
   want to exit interactive mode.
 - Call cursor_update_focus() from view_destroy() if the view had mouse
   focus or was being interactively moved/resized.

v2: Eliminate force_reenter parameters and figure out automatically
    when we need to re-enter the surface.
v3: Rename wlseat -> wlr_seat.
v4: Simplify client/server cursor logic.
include/labwc.h
src/cursor.c
src/desktop.c
src/interactive.c
src/view.c
src/xwayland-unmanaged.c