mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
bug 1180008 provide gtk_window_get_window_type for old GTK versions r=glandium
--HG-- extra : rebase_source : c1d1f1778f27152ce2e6470b44d77939f97cb777
This commit is contained in:
parent
57a5698c57
commit
ff72a52865
@ -6,8 +6,10 @@
|
||||
#define GTKWINDOW_WRAPPER_H
|
||||
|
||||
#define gtk_window_group_get_current_grab gtk_window_group_get_current_grab_
|
||||
#define gtk_window_get_window_type gtk_window_get_window_type_
|
||||
#include_next <gtk/gtkwindow.h>
|
||||
#undef gtk_window_group_get_current_grab
|
||||
#undef gtk_window_get_window_type
|
||||
|
||||
static inline GtkWidget *
|
||||
gtk_window_group_get_current_grab(GtkWindowGroup *window_group)
|
||||
@ -17,4 +19,12 @@ gtk_window_group_get_current_grab(GtkWindowGroup *window_group)
|
||||
|
||||
return GTK_WIDGET(window_group->grabs->data);
|
||||
}
|
||||
|
||||
static inline GtkWindowType
|
||||
gtk_window_get_window_type(GtkWindow *window)
|
||||
{
|
||||
gint type;
|
||||
g_object_get(window, "type", &type, (void*)NULL);
|
||||
return (GtkWindowType)type;
|
||||
}
|
||||
#endif /* GTKWINDOW_WRAPPER_H */
|
||||
|
@ -2360,13 +2360,9 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent)
|
||||
// This event indicates that the window position may have changed.
|
||||
// mBounds.Size() is updated in OnSizeAllocate().
|
||||
|
||||
// (The gtk_window_get_window_type() function is only available from
|
||||
// version 2.20.)
|
||||
NS_ASSERTION(GTK_IS_WINDOW(aWidget),
|
||||
"Configure event on widget that is not a GtkWindow");
|
||||
gint type;
|
||||
g_object_get(aWidget, "type", &type, nullptr);
|
||||
if (type == GTK_WINDOW_POPUP) {
|
||||
if (gtk_window_get_window_type(GTK_WINDOW(aWidget)) == GTK_WINDOW_POPUP) {
|
||||
// Override-redirect window
|
||||
//
|
||||
// These windows should not be moved by the window manager, and so any
|
||||
|
Loading…
Reference in New Issue
Block a user