display: Add a helper to retrieve associated xwindow

As we moved the xwindow property from Window to WindowX11 which is
not exposed as public API. So instead of exposing WindowX11,
the API is added to MetaX11Display which is already exposed.

This is only needed by gnome-shell for it tray icons support
https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/81f18d7d/src/shell-tray-icon.c#L67

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3211>
This commit is contained in:
Bilal Elmoussaoui 2023-11-22 11:01:23 +01:00 committed by Robert Mader
parent 0236506cff
commit 5ad8a79823
2 changed files with 17 additions and 0 deletions

View File

@ -58,3 +58,7 @@ void meta_x11_display_remove_event_func (MetaX11Display *x11_display,
META_EXPORT
void meta_x11_display_redirect_windows (MetaX11Display *x11_display,
MetaDisplay *display);
META_EXPORT
Window meta_x11_display_lookup_xwindow (MetaX11Display *x11_display,
MetaWindow *window);

View File

@ -2557,3 +2557,16 @@ meta_x11_display_redirect_windows (MetaX11Display *x11_display,
g_usleep (G_USEC_PER_SEC);
}
}
Window
meta_x11_display_lookup_xwindow (MetaX11Display *x11_display,
MetaWindow *window)
{
g_return_val_if_fail (META_IS_X11_DISPLAY (x11_display), None);
g_return_val_if_fail (META_IS_WINDOW (window), None);
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
return meta_window_x11_get_xwindow (window);
return None;
}