summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-05-01 03:23:46 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-05-01 03:23:46 +0000
commit03481ae2d08f5ad0d69f13bd43863db6f91de599 (patch)
treec407ccd77a9e57b0e600f383f4c248186573488c /src/tools
parent17b4eab4d44b34134f8b9f89fff4c4411205fdc9 (diff)
downloadmetacity-03481ae2d08f5ad0d69f13bd43863db6f91de599.tar.gz
metacity-03481ae2d08f5ad0d69f13bd43863db6f91de599.tar.bz2
don't try to decorate toolbars.
2002-04-30 Havoc Pennington <hp@pobox.com> * src/window.c (recalc_window_features): don't try to decorate toolbars. * src/tools/metacity-window-demo.c: add menu and toolbar tests * src/place.c (meta_window_place): only dialogs should be centered over parent, not anything with transient for set. * src/window.c (meta_window_configure_request): become more fascist about window positioning if workarounds are disabled, and less fascist if they are enabled. * src/metacity.schemas: add a "disable_workarounds" option. Kind of crack-smoking. But we just can't get all applications fixed. And I need no-workarounds mode to monitor which apps are broken and what needs fixing in specs. * src/window.c (meta_window_configure_request): always allow windows to resize themselves * src/keybindings.c (reload_modmap): don't filter out Mode_switch, apparently some people bind window manager shortcuts to that.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/metacity-window-demo.c60
1 files changed, 56 insertions, 4 deletions
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index dc64952..73b27c4 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -260,6 +260,56 @@ utility_cb (gpointer callback_data,
gtk_widget_show_all (window);
}
+static void
+toolbar_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_type (GTK_WINDOW (window), "_NET_WM_WINDOW_TYPE_TOOLBAR");
+ gtk_window_set_title (GTK_WINDOW (window), "Toolbar");
+
+ 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 ("FIXME this needs a resize grip, etc.");
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ gtk_widget_show_all (window);
+}
+
+static void
+menu_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_type (GTK_WINDOW (window), "_NET_WM_WINDOW_TYPE_MENU");
+ gtk_window_set_title (GTK_WINDOW (window), "Menu");
+
+ 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 ("FIXME this isn't a menu.");
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ gtk_widget_show_all (window);
+}
+
static gboolean
focus_in_event_cb (GtkWidget *window,
GdkEvent *event,
@@ -470,7 +520,9 @@ static GtkItemFactoryEntry menu_items[] =
{ "/Windows/_Left dock", NULL, dock_cb, DOCK_LEFT, NULL },
{ "/Windows/_Right dock", NULL, dock_cb, DOCK_RIGHT, NULL },
{ "/Windows/_All docks", NULL, dock_cb, DOCK_ALL, NULL },
- { "/Windows/Des_ktop", NULL, desktop_cb, 0, NULL }
+ { "/Windows/Des_ktop", NULL, desktop_cb, 0, NULL },
+ { "/Windows/Me_nu", NULL, menu_cb, 0, NULL },
+ { "/Windows/Tool_bar", NULL, toolbar_cb, 0, NULL }
};
static void
@@ -481,8 +533,8 @@ sleep_cb (GtkWidget *button,
}
static void
-toolbar_cb (GtkWidget *button,
- gpointer data)
+clicked_toolbar_cb (GtkWidget *button,
+ gpointer data)
{
GtkWidget *dialog;
@@ -629,7 +681,7 @@ do_appwindow (void)
GTK_STOCK_QUIT,
"This is a demo button with a 'quit' icon",
NULL,
- G_CALLBACK (toolbar_cb),
+ G_CALLBACK (clicked_toolbar_cb),
window, /* user data for callback */
-1); /* -1 means "append" */