diff --git a/src/meta/meta-x11-display.h b/src/meta/meta-x11-display.h index 58fc1b620..9be447e17 100644 --- a/src/meta/meta-x11-display.h +++ b/src/meta/meta-x11-display.h @@ -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); diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index d9937bd8f..21f8cadad 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -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; +}