summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index d69224ece..13633c938 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -44,8 +44,6 @@
static void meta_frames_destroy (GtkWidget *object);
static void meta_frames_finalize (GObject *object);
static void meta_frames_style_updated (GtkWidget *widget);
-static void meta_frames_map (GtkWidget *widget);
-static void meta_frames_unmap (GtkWidget *widget);
static void meta_frames_update_prelit_control (MetaFrames *frames,
MetaUIFrame *frame,
@@ -134,9 +132,6 @@ meta_frames_class_init (MetaFramesClass *class)
widget_class->style_updated = meta_frames_style_updated;
- widget_class->map = meta_frames_map;
- widget_class->unmap = meta_frames_unmap;
-
widget_class->draw = meta_frames_draw;
widget_class->destroy_event = meta_frames_destroy_event;
widget_class->button_press_event = meta_frames_button_press_event;
@@ -231,6 +226,7 @@ meta_frames_init (MetaFrames *frames)
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
+
update_style_contexts (frames);
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
@@ -522,13 +518,26 @@ MetaFrames*
meta_frames_new (int screen_number)
{
GdkScreen *screen;
+ MetaFrames *frames;
screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number);
- return g_object_new (META_TYPE_FRAMES,
- "screen", screen,
- NULL);
+ frames = g_object_new (META_TYPE_FRAMES,
+ "screen", screen,
+ "type", GTK_WINDOW_POPUP,
+ NULL);
+
+ /* Put the window at an arbitrary offscreen location; the one place
+ * it can't be is at -100x-100, since the meta_window_new() will
+ * mistake it for a window created via meta_create_offscreen_window()
+ * and ignore it, and we need this window to get frame-synchronization
+ * messages so that GTK+'s style change handling works.
+ */
+ gtk_window_move (GTK_WINDOW (frames), -200, -200);
+ gtk_window_resize (GTK_WINDOW (frames), 1, 1);
+
+ return frames;
}
/* In order to use a style with a window it has to be attached to that
@@ -635,22 +644,6 @@ meta_frames_unmanage_window (MetaFrames *frames,
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
}
-static void
-meta_frames_map (GtkWidget *widget)
-{
- /* We override the parent map function to a no-op because we don't
- * want to actually show the GDK window. But GTK needs to think that
- * the widget is mapped or it won't deliver the events we care about.
- */
- gtk_widget_set_mapped (widget, TRUE);
-}
-
-static void
-meta_frames_unmap (GtkWidget *widget)
-{
- gtk_widget_set_mapped (widget, FALSE);
-}
-
static MetaUIFrame*
meta_frames_lookup_window (MetaFrames *frames,
Window xwindow)