xwayland: set the surface title when running rootful
Set a meaningful title for the xdg_surface, it's nicer when running rootful. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
		
							parent
							
								
									d0466e842a
								
							
						
					
					
						commit
						7a517f3967
					
				| 
						 | 
				
			
			@ -987,6 +987,7 @@ static void
 | 
			
		|||
maybe_toggle_fake_grab(struct xwl_seat *xwl_seat, uint32_t key)
 | 
			
		||||
{
 | 
			
		||||
    struct xwl_screen *xwl_screen = xwl_seat->xwl_screen;
 | 
			
		||||
    struct xwl_window *xwl_window;
 | 
			
		||||
    XkbStateRec state_rec;
 | 
			
		||||
    uint32_t xkb_state;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1008,6 +1009,10 @@ maybe_toggle_fake_grab(struct xwl_seat *xwl_seat, uint32_t key)
 | 
			
		|||
            maybe_fake_grab_devices(xwl_seat);
 | 
			
		||||
        else
 | 
			
		||||
            maybe_fake_ungrab_devices(xwl_seat);
 | 
			
		||||
 | 
			
		||||
        xwl_window = xwl_window_get(xwl_screen->screen->root);
 | 
			
		||||
        if (xwl_window)
 | 
			
		||||
            xwl_window_rootful_update_title(xwl_window);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -469,6 +469,26 @@ xwl_window_set_fullscreen(struct xwl_window *xwl_window)
 | 
			
		|||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
xwl_window_rootful_update_title(struct xwl_window *xwl_window)
 | 
			
		||||
{
 | 
			
		||||
    struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
 | 
			
		||||
    char title[128];
 | 
			
		||||
    const char *grab_message = "";
 | 
			
		||||
 | 
			
		||||
    if (xwl_screen->host_grab) {
 | 
			
		||||
        if (xwl_screen->has_grab)
 | 
			
		||||
            grab_message = " - ([ctrl]+[shift] releases mouse and keyboard)";
 | 
			
		||||
        else
 | 
			
		||||
            grab_message = " - ([ctrl]+[shift] grabs mouse and keyboard)";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    snprintf(title, sizeof(title), "Xwayland on :%s%s", display, grab_message);
 | 
			
		||||
 | 
			
		||||
    if (xwl_window->xdg_toplevel)
 | 
			
		||||
        xdg_toplevel_set_title(xwl_window->xdg_toplevel, title);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
xdg_surface_handle_configure(void *data,
 | 
			
		||||
                             struct xdg_surface *xdg_surface,
 | 
			
		||||
| 
						 | 
				
			
			@ -547,6 +567,8 @@ xwl_create_root_surface(struct xwl_window *xwl_window)
 | 
			
		|||
    xdg_surface_add_listener(xwl_window->xdg_surface,
 | 
			
		||||
                             &xdg_surface_listener, xwl_window);
 | 
			
		||||
 | 
			
		||||
    xwl_window_rootful_update_title(xwl_window);
 | 
			
		||||
 | 
			
		||||
    wl_surface_commit(xwl_window->surface);
 | 
			
		||||
 | 
			
		||||
    region = wl_compositor_create_region(xwl_screen->compositor);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,8 +68,10 @@ void xwl_window_update_property(struct xwl_window *xwl_window,
 | 
			
		|||
Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window);
 | 
			
		||||
Bool xwl_window_is_toplevel(WindowPtr window);
 | 
			
		||||
void xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window);
 | 
			
		||||
void xwl_window_rootful_update_title(struct xwl_window *xwl_window);
 | 
			
		||||
 | 
			
		||||
void xwl_window_set_window_pixmap(WindowPtr window, PixmapPtr pixmap);
 | 
			
		||||
 | 
			
		||||
Bool xwl_realize_window(WindowPtr window);
 | 
			
		||||
Bool xwl_unrealize_window(WindowPtr window);
 | 
			
		||||
Bool xwl_change_window_attributes(WindowPtr window, unsigned long mask);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue