mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 07:00:09 +01:00
xwayland: Create a dummy no_focus_window to use for non-X window focus
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
This commit is contained in:
parent
4ab8d6d2c4
commit
87ae07b63f
2 changed files with 31 additions and 0 deletions
|
|
@ -2685,6 +2685,32 @@ weston_wm_create_wm_window(struct weston_wm *wm)
|
|||
XCB_TIME_CURRENT_TIME);
|
||||
}
|
||||
|
||||
static void
|
||||
weston_wm_create_no_focus_window(struct weston_wm *wm)
|
||||
{
|
||||
uint32_t values[2];
|
||||
|
||||
values[0] = 1;
|
||||
values[1] =
|
||||
XCB_EVENT_MASK_KEY_PRESS |
|
||||
XCB_EVENT_MASK_KEY_RELEASE |
|
||||
XCB_EVENT_MASK_FOCUS_CHANGE;
|
||||
|
||||
wm->no_focus_window = xcb_generate_id(wm->conn);
|
||||
xcb_create_window(wm->conn,
|
||||
XCB_COPY_FROM_PARENT,
|
||||
wm->no_focus_window,
|
||||
wm->screen->root,
|
||||
-100, -100, 1, 1,
|
||||
0,
|
||||
XCB_WINDOW_CLASS_COPY_FROM_PARENT,
|
||||
XCB_COPY_FROM_PARENT,
|
||||
XCB_CW_OVERRIDE_REDIRECT |
|
||||
XCB_CW_EVENT_MASK,
|
||||
values);
|
||||
xcb_map_window(wm->conn, wm->no_focus_window);
|
||||
}
|
||||
|
||||
static void
|
||||
free_xwl_surface(struct wl_resource *resource)
|
||||
{
|
||||
|
|
@ -2935,6 +2961,10 @@ weston_wm_create(struct weston_xserver *wxs, int fd)
|
|||
* signals to Xwayland that we're done with setup. */
|
||||
weston_wm_create_wm_window(wm);
|
||||
|
||||
/* Create a dummy no_focus_window to use when focus changes
|
||||
* to a non-X window. */
|
||||
weston_wm_create_no_focus_window(wm);
|
||||
|
||||
weston_log("created wm, root %d\n", wm->screen->root);
|
||||
|
||||
return wm;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ struct weston_wm {
|
|||
struct weston_xserver *server;
|
||||
struct wl_global *xwayland_shell_global;
|
||||
xcb_window_t wm_window;
|
||||
xcb_window_t no_focus_window;
|
||||
struct weston_wm_window *focus_window;
|
||||
struct theme *theme;
|
||||
xcb_cursor_t *cursors;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue