This source file includes following definitions.
- StackPopupWindow
#include "ui/base/gtk/gtk_windowing.h"
#include <gdk/gdkx.h>
#include "base/logging.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/gtk_compat.h"
namespace ui {
void StackPopupWindow(GtkWidget* popup, GtkWidget* toplevel) {
DCHECK(GTK_IS_WINDOW(popup) && gtk_widget_is_toplevel(popup) &&
gtk_widget_get_realized(popup));
DCHECK(GTK_IS_WINDOW(toplevel) && gtk_widget_is_toplevel(toplevel) &&
gtk_widget_get_realized(toplevel));
gdk_x11_display_grab(gtk_widget_get_display(toplevel));
XID toplevel_window_base = ui::GetHighestAncestorWindow(
ui::GetX11WindowFromGtkWidget(toplevel),
ui::GetX11RootWindow());
if (toplevel_window_base) {
XID window_xid = ui::GetX11WindowFromGtkWidget(popup);
XID window_parent = ui::GetParentWindow(window_xid);
if (window_parent == ui::GetX11RootWindow()) {
ui::RestackWindow(window_xid, toplevel_window_base, true);
} else {
DLOG(ERROR) << "override-redirect window " << window_xid
<< "'s parent is " << window_parent
<< ", rather than root window "
<< ui::GetX11RootWindow();
}
}
gdk_x11_display_ungrab(gtk_widget_get_display(toplevel));
}
}