mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
update the cursor on next commit after xdg surface map
we can't update the cursor properly upon map, because windows may not have committed a buffer by then. deferring cursor updates until commit lets us find the buffer in the scene tree and see if the pointer is within it.
This commit is contained in:
parent
4f0b72c341
commit
90b5f74ef1
2 changed files with 4 additions and 1 deletions
|
|
@ -46,6 +46,7 @@ struct view {
|
||||||
|
|
||||||
bool mapped;
|
bool mapped;
|
||||||
bool been_mapped;
|
bool been_mapped;
|
||||||
|
bool committed_since_mapped;
|
||||||
bool ssd_enabled;
|
bool ssd_enabled;
|
||||||
bool minimized;
|
bool minimized;
|
||||||
bool maximized;
|
bool maximized;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ handle_commit(struct wl_listener *listener, void *data)
|
||||||
struct wlr_box size;
|
struct wlr_box size;
|
||||||
wlr_xdg_surface_get_geometry(xdg_surface, &size);
|
wlr_xdg_surface_get_geometry(xdg_surface, &size);
|
||||||
|
|
||||||
bool update_required = false;
|
bool update_required = !view->committed_since_mapped;
|
||||||
|
view->committed_since_mapped = true;
|
||||||
|
|
||||||
if (view->w != size.width || view->h != size.height) {
|
if (view->w != size.width || view->h != size.height) {
|
||||||
update_required = true;
|
update_required = true;
|
||||||
|
|
@ -350,6 +351,7 @@ xdg_toplevel_view_map(struct view *view)
|
||||||
view_moved(view);
|
view_moved(view);
|
||||||
view->been_mapped = true;
|
view->been_mapped = true;
|
||||||
}
|
}
|
||||||
|
view->committed_since_mapped = false;
|
||||||
|
|
||||||
view->commit.notify = handle_commit;
|
view->commit.notify = handle_commit;
|
||||||
wl_signal_add(&xdg_surface->surface->events.commit, &view->commit);
|
wl_signal_add(&xdg_surface->surface->events.commit, &view->commit);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue