summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@gnu.org>2002-05-08 16:24:28 +0000
committerAnders Carlsson <andersca@src.gnome.org>2002-05-08 16:24:28 +0000
commit0494b044d50d60e153f5197ea130e7db57a97824 (patch)
tree81d912913ab5855cea45bab23d51c8536ec62350 /src
parent3f7203a3a4d20a4c699475d74467afae579341d3 (diff)
downloadmetacity-0494b044d50d60e153f5197ea130e7db57a97824.tar.gz
metacity-0494b044d50d60e153f5197ea130e7db57a97824.tar.bz2
Add multi-screen support. Also add patch by Erwann Chenede to make
2002-05-08 Anders Carlsson <andersca@gnu.org> * configure.in: * src/display.c: (meta_display_open): * src/fixedtip.c: (meta_fixed_tip_show): * src/fixedtip.h: * src/frames.c: (meta_frames_new), (show_tip_now): * src/frames.h: * src/menu.c: (meta_window_menu_new): * src/ui.c: (meta_ui_new): Add multi-screen support. Also add patch by Erwann Chenede to make tooltips appear on the correct screen.
Diffstat (limited to 'src')
-rw-r--r--src/display.c5
-rw-r--r--src/fixedtip.c5
-rw-r--r--src/fixedtip.h2
-rw-r--r--src/frames.c25
-rw-r--r--src/frames.h2
-rw-r--r--src/menu.c5
-rw-r--r--src/ui.c4
7 files changed, 37 insertions, 11 deletions
diff --git a/src/display.c b/src/display.c
index c707fc2..638aefa 100644
--- a/src/display.c
+++ b/src/display.c
@@ -323,8 +323,9 @@ meta_display_open (const char *name)
display->no_focus_window = None;
screens = NULL;
-#if 0
- /* disable multihead pending GTK support */
+
+#ifdef HAVE_GTK_MULTIHEAD
+
i = 0;
while (i < ScreenCount (xdisplay))
{
diff --git a/src/fixedtip.c b/src/fixedtip.c
index fb016a3..690576b 100644
--- a/src/fixedtip.c
+++ b/src/fixedtip.c
@@ -36,13 +36,16 @@ expose_handler (GtkTooltips *tooltips)
}
void
-meta_fixed_tip_show (Display *xdisplay,
+meta_fixed_tip_show (Display *xdisplay, int screen_number,
int root_x, int root_y,
const char *markup_text)
{
if (tip == NULL)
{
tip = gtk_window_new (GTK_WINDOW_POPUP);
+ gtk_window_set_screen (GTK_WINDOW (tip),
+ gdk_display_get_screen (gdk_get_default_display (),
+ screen_number));
gtk_widget_set_app_paintable (tip, TRUE);
gtk_window_set_policy (GTK_WINDOW (tip), FALSE, FALSE, TRUE);
gtk_widget_set_name (tip, "gtk-tooltips");
diff --git a/src/fixedtip.h b/src/fixedtip.h
index 9f167b0..96f54d5 100644
--- a/src/fixedtip.h
+++ b/src/fixedtip.h
@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-void meta_fixed_tip_show (Display *xdisplay,
+void meta_fixed_tip_show (Display *xdisplay, int screen_number,
int root_x, int root_y,
const char *markup_text);
void meta_fixed_tip_hide (void);
diff --git a/src/frames.c b/src/frames.c
index e98a890..e5f57e2 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -400,9 +400,22 @@ meta_frames_calc_geometry (MetaFrames *frames,
}
MetaFrames*
-meta_frames_new (void)
+meta_frames_new (int screen_number)
{
- return g_object_new (META_TYPE_FRAMES, NULL);
+#ifdef HAVE_GTK_MULTIHEAD
+ GdkScreen *screen;
+
+ screen = gdk_display_get_screen (gdk_get_default_display (),
+ screen_number);
+
+ return g_object_new (META_TYPE_FRAMES,
+ "screen", screen,
+ NULL);
+#else
+ return g_object_new (META_TYPE_FRAMES,
+ NULL);
+#endif
+
}
void
@@ -706,6 +719,7 @@ show_tip_now (MetaFrames *frames)
MetaFrameGeometry fgeom;
GdkRectangle *rect;
int dx, dy;
+ int screen_number;
meta_frames_calc_geometry (frames, frame, &fgeom);
@@ -714,8 +728,13 @@ show_tip_now (MetaFrames *frames)
/* get conversion delta for root-to-frame coords */
dx = root_x - x;
dy = root_y - y;
-
+#ifdef HAVE_GTK_MULTIHEAD
+ screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
+#else
+ screen_number = XScreenNumberOfScreen (DefaultScreen (gdk_display));
+#endif
meta_fixed_tip_show (gdk_display,
+ screen_number,
rect->x + dx,
rect->y + rect->height + 2 + dy,
tiptext);
diff --git a/src/frames.h b/src/frames.h
index dc81f7b..a295b9e 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -99,7 +99,7 @@ struct _MetaFramesClass
GType meta_frames_get_type (void) G_GNUC_CONST;
-MetaFrames *meta_frames_new (void);
+MetaFrames *meta_frames_new (int screen_number);
void meta_frames_manage_window (MetaFrames *frames,
Window xwindow);
diff --git a/src/menu.c b/src/menu.c
index 7d9b5bc..7af1c11 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -175,7 +175,10 @@ meta_window_menu_new (MetaFrames *frames,
menu->insensitive = insensitive;
menu->menu = gtk_menu_new ();
-
+#ifdef HAVE_GTK_MULTIHEAD
+ gtk_menu_set_screen (GTK_MENU (menu->menu),
+ gtk_widget_get_screen (GTK_WIDGET (frames)));
+#endif
i = 0;
while (i < (int) G_N_ELEMENTS (menuitems))
{
diff --git a/src/ui.c b/src/ui.c
index e81acd7..87eeef9 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -141,8 +141,8 @@ meta_ui_new (Display *xdisplay,
ui->xdisplay = xdisplay;
ui->xscreen = screen;
- /* FIXME when gtk has multihead use it here */
- ui->frames = meta_frames_new ();
+ g_assert (xdisplay == gdk_display);
+ ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
gtk_widget_realize (GTK_WIDGET (ui->frames));
return ui;