summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-06-22 03:23:02 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-06-22 03:23:02 +0000
commitde42a62f4e076df117449c1b3eeac51d7e5571a9 (patch)
treed1770e967be1611940c3dbad371e88eb08d390ae /src/tools
parent854e58fd82a9b2dc6295ccc0bcf6b3cf688cf78d (diff)
downloadmetacity-de42a62f4e076df117449c1b3eeac51d7e5571a9.tar.gz
metacity-de42a62f4e076df117449c1b3eeac51d7e5571a9.tar.bz2
Theme breakage! Themes have to implement "border" frames now, see Atlanta
2002-06-21 Havoc Pennington <hp@pobox.com> Theme breakage! Themes have to implement "border" frames now, see Atlanta for an example. Fixes #84285 * src/tools/metacity-window-demo.c (do_appwindow): add a border-only window * src/window.c (update_mwm_hints): read border only from the MWM hints * src/window.h (struct _MetaWindow): add border_only flag * src/core.c (meta_core_get_frame_type): report border type if required * src/common.h (enum): add META_FRAME_TYPE_BORDER
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/metacity-window-demo.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index 933840e..6afa569 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -151,6 +151,37 @@ set_gtk_window_type (GtkWindow *window,
type);
}
+static void
+set_gdk_window_border_only (GdkWindow *window)
+{
+ gdk_window_set_decorations (window, GDK_DECOR_BORDER);
+}
+
+static void
+on_realize_set_border_only (GtkWindow *window,
+ gpointer data)
+{
+ g_return_if_fail (GTK_WIDGET_REALIZED (window));
+
+ set_gdk_window_border_only (GTK_WIDGET (window)->window);
+}
+
+static void
+set_gtk_window_border_only (GtkWindow *window)
+{
+ g_signal_handlers_disconnect_by_func (G_OBJECT (window),
+ on_realize_set_border_only,
+ NULL);
+
+ g_signal_connect_after (G_OBJECT (window),
+ "realize",
+ G_CALLBACK (on_realize_set_border_only),
+ NULL);
+
+ if (GTK_WIDGET_REALIZED (window))
+ set_gdk_window_border_only (GTK_WIDGET (window)->window);
+}
+
int
main (int argc, char **argv)
{
@@ -333,6 +364,31 @@ override_redirect_cb (gpointer callback_data,
}
static void
+border_only_cb (gpointer callback_data,
+ guint callback_action,
+ GtkWidget *widget)
+{
+ GtkWidget *window;
+ GtkWidget *vbox;
+ GtkWidget *label;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ set_gtk_window_border_only (GTK_WINDOW (window));
+ gtk_window_set_title (GTK_WINDOW (window), "Border only");
+
+ gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (callback_data));
+
+ vbox = gtk_vbox_new (FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
+ label = gtk_label_new ("This window is supposed to have a border but no titlebar.");
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ gtk_widget_show_all (window);
+}
+
+static void
changing_icon_cb (gpointer callback_data,
guint callback_action,
GtkWidget *widget)
@@ -567,7 +623,8 @@ static GtkItemFactoryEntry menu_items[] =
{ "/Windows/Des_ktop", NULL, desktop_cb, 0, NULL },
{ "/Windows/Me_nu", NULL, menu_cb, 0, NULL },
{ "/Windows/Tool_bar", NULL, toolbar_cb, 0, NULL },
- { "/Windows/Override Redirect", NULL, override_redirect_cb, 0, NULL }
+ { "/Windows/Override Redirect", NULL, override_redirect_cb, 0, NULL },
+ { "/Windows/Border Only", NULL, border_only_cb, 0, NULL }
};
static void