mirror of
https://github.com/labwc/labwc.git
synced 2026-04-10 08:21:07 -04:00
[wip] layer: update cursor on commit
...to get a pointer-enter event when a new layer surface appears under the cursor. This enables gdk_device_get_window_at_position() to work without moving pointer. Fixes issue #667
This commit is contained in:
parent
8b0d5969a6
commit
5797f475a4
1 changed files with 15 additions and 3 deletions
18
src/layers.c
18
src/layers.c
|
|
@ -138,6 +138,15 @@ surface_commit_notify(struct wl_listener *listener, void *data)
|
||||||
output_from_wlr_output(layer->server, wlr_output);
|
output_from_wlr_output(layer->server, wlr_output);
|
||||||
layers_arrange(output);
|
layers_arrange(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We need to call cursor_update_focus() to get a pointer-enter event
|
||||||
|
* when a new layer surface appears under the cursor. This enables
|
||||||
|
* gdk_device_get_window_at_position() to work without moving pointer.
|
||||||
|
* See issue #667
|
||||||
|
*/
|
||||||
|
struct output *output = (struct output *)layer_surface->output->data;
|
||||||
|
cursor_update_focus(output->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -182,9 +191,12 @@ unmap_notify(struct wl_listener *listener, void *data)
|
||||||
static void
|
static void
|
||||||
map_notify(struct wl_listener *listener, void *data)
|
map_notify(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
return;
|
/*
|
||||||
struct wlr_layer_surface_v1 *layer_surface = data;
|
* Since moving to the wlroots scene-graph API, there is no need to
|
||||||
wlr_surface_send_enter(layer_surface->surface, layer_surface->output);
|
* call wlr_surface_send_enter() from here since that will be done
|
||||||
|
* automatically based on the position of the surface and outputs in
|
||||||
|
* the scene. See wlr_scene_surface_create() documentation.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue