From ec9cf27a818870efc999b65eaadafffb867b665e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 21 Apr 2003 23:37:42 +0000 Subject: [PATCH] purge HAVE_GTK_MULTIHEAD from the source code, not just from configure.in. 2003-04-21 Havoc Pennington * purge HAVE_GTK_MULTIHEAD from the source code, not just from configure.in. Yes I am a loser. --- ChangeLog | 5 +++++ src/Makefile.am | 2 +- src/display.c | 9 --------- src/fixedtip.c | 5 ----- src/frames.c | 19 ++----------------- src/menu.c | 22 +++++++--------------- src/resizepopup.c | 3 +-- src/tabpopup.c | 6 ++---- src/ui.c | 24 ++++++++---------------- 9 files changed, 26 insertions(+), 69 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4b97bc1a..189bbed3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-04-21 Havoc Pennington + + * purge HAVE_GTK_MULTIHEAD from the source code, not just from + configure.in. Yes I am a loser. + 2003-04-19 Masahiro Sakai * configure.in: call AC_LIBTOOL_WIN32_DLL. diff --git a/src/Makefile.am b/src/Makefile.am index be6d1e9a1..c5fdf4ef3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,7 +102,7 @@ libmetacity_private_la_SOURCES= \ common.h libmetacity_private_la_LDFLAGS = -no-undefined -libmetacity_private_la_LIBADD = $(METACITY_LIBS) +libmetacity_private_la_LIBADD = @METACITY_LIBS@ libmetacityincludedir = $(includedir)/metacity-1/metacity-private diff --git a/src/display.c b/src/display.c index 27fd6f542..d26930e81 100644 --- a/src/display.c +++ b/src/display.c @@ -528,7 +528,6 @@ meta_display_open (const char *name) screens = NULL; -#ifdef HAVE_GTK_MULTIHEAD i = 0; while (i < ScreenCount (xdisplay)) { @@ -540,14 +539,6 @@ meta_display_open (const char *name) screens = g_slist_prepend (screens, screen); ++i; } -#else - { - MetaScreen *screen; - screen = meta_screen_new (display, DefaultScreen (xdisplay)); - if (screen) - screens = g_slist_prepend (screens, screen); - } -#endif display->screens = screens; diff --git a/src/fixedtip.c b/src/fixedtip.c index 817ae9414..047b0d14c 100644 --- a/src/fixedtip.c +++ b/src/fixedtip.c @@ -48,7 +48,6 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, if (tip == NULL) { tip = gtk_window_new (GTK_WINDOW_POPUP); -#ifdef HAVE_GTK_MULTIHEAD { GdkScreen *gdk_screen; @@ -59,10 +58,6 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, screen_width = gdk_screen_get_width (gdk_screen); screen_height = gdk_screen_get_height (gdk_screen); } -#else - screen_width = gdk_screen_width (); - screen_height = gdk_screen_height (); -#endif gtk_widget_set_app_paintable (tip, TRUE); gtk_window_set_policy (GTK_WINDOW (tip), FALSE, FALSE, TRUE); diff --git a/src/frames.c b/src/frames.c index 7e9d2d3e7..600658955 100644 --- a/src/frames.c +++ b/src/frames.c @@ -452,7 +452,6 @@ meta_frames_calc_geometry (MetaFrames *frames, MetaFrames* meta_frames_new (int screen_number) { -#ifdef HAVE_GTK_MULTIHEAD GdkScreen *screen; screen = gdk_display_get_screen (gdk_display_get_default (), @@ -460,12 +459,7 @@ meta_frames_new (int screen_number) return g_object_new (META_TYPE_FRAMES, "screen", screen, - NULL); -#else - return g_object_new (META_TYPE_FRAMES, - NULL); -#endif - + NULL); } void @@ -835,21 +829,15 @@ meta_frames_apply_shapes (MetaFrames *frames, Window shape_window; Window client_window; Region client_xregion; -#ifdef HAVE_GTK_MULTIHEAD GdkScreen *screen; -#endif int screen_number; meta_topic (META_DEBUG_SHAPES, "Frame 0x%lx needs to incorporate client shape\n", frame->xwindow); -#ifdef HAVE_GTK_MULTIHEAD screen = gtk_widget_get_screen (GTK_WIDGET (frames)); screen_number = gdk_x11_screen_get_screen_number (screen); -#else - screen_number = DefaultScreen (gdk_display); -#endif attrs.override_redirect = True; @@ -1057,11 +1045,8 @@ 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 = DefaultScreen (gdk_display); -#endif + meta_fixed_tip_show (gdk_display, screen_number, rect->x + dx, diff --git a/src/menu.c b/src/menu.c index 8c1e0faa8..4cfaeaea6 100644 --- a/src/menu.c +++ b/src/menu.c @@ -241,10 +241,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)) { @@ -321,20 +321,12 @@ meta_window_menu_new (MetaFrames *frames, GtkWidget *mi; Display *display; Window xroot; - + GdkScreen *screen; + display = gdk_x11_drawable_get_xdisplay (GTK_WIDGET (frames)->window); - -#ifdef HAVE_GTK_MULTIHEAD - { - GdkScreen *screen; - screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window); - xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen)); - } -#else - { - xroot = gdk_x11_get_default_root_xwindow (); - } -#endif + + screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window); + xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen)); i = 0; while (i < n_workspaces) diff --git a/src/resizepopup.c b/src/resizepopup.c index 5b7b9a45b..a20d4682e 100644 --- a/src/resizepopup.c +++ b/src/resizepopup.c @@ -92,11 +92,10 @@ ensure_size_window (MetaResizePopup *popup) return; popup->size_window = gtk_window_new (GTK_WINDOW_POPUP); -#ifdef HAVE_GTK_MULTIHEAD + gtk_window_set_screen (GTK_WINDOW (popup->size_window), gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display), popup->screen_number)); -#endif /* never shrink the size window */ gtk_window_set_resizable (GTK_WINDOW (popup->size_window), diff --git a/src/tabpopup.c b/src/tabpopup.c index 58e2a2ab9..843edbfb3 100644 --- a/src/tabpopup.c +++ b/src/tabpopup.c @@ -122,11 +122,10 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, popup = g_new (MetaTabPopup, 1); popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP); -#ifdef HAVE_GTK_MULTIHEAD + gtk_window_set_screen (GTK_WINDOW (popup->outline_window), gdk_display_get_screen (gdk_display_get_default (), screen_number)); -#endif gtk_widget_set_app_paintable (popup->outline_window, TRUE); gtk_widget_realize (popup->outline_window); @@ -135,11 +134,10 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries, G_CALLBACK (outline_window_expose), popup); popup->window = gtk_window_new (GTK_WINDOW_POPUP); -#ifdef HAVE_GTK_MULTIHEAD + gtk_window_set_screen (GTK_WINDOW (popup->window), gdk_display_get_screen (gdk_display_get_default (), screen_number)); -#endif gtk_window_set_position (GTK_WINDOW (popup->window), GTK_WIN_POS_CENTER_ALWAYS); diff --git a/src/ui.c b/src/ui.c index 945a097c5..f140f3508 100644 --- a/src/ui.c +++ b/src/ui.c @@ -290,21 +290,16 @@ meta_image_window_new (Display *xdisplay, int max_height) { MetaImageWindow *iw; - + GdkDisplay *gdisplay; + GdkScreen *gscreen; + iw = g_new (MetaImageWindow, 1); iw->window = gtk_window_new (GTK_WINDOW_POPUP); - -#ifdef HAVE_GTK_MULTIHEAD - { - GdkDisplay *gdisplay; - GdkScreen *gscreen; - gdisplay = gdk_x11_lookup_xdisplay (xdisplay); - gscreen = gdk_display_get_screen (gdisplay, screen_number); - - gtk_window_set_screen (GTK_WINDOW (iw->window), gscreen); - } -#endif + gdisplay = gdk_x11_lookup_xdisplay (xdisplay); + gscreen = gdk_display_get_screen (gdisplay, screen_number); + + gtk_window_set_screen (GTK_WINDOW (iw->window), gscreen); gtk_widget_realize (iw->window); iw->pixmap = gdk_pixmap_new (iw->window->window, @@ -391,11 +386,8 @@ get_cmap (GdkPixmap *pixmap) else { meta_verbose ("Using system cmap to snapshot pixmap\n"); -#ifdef HAVE_GTK_MULTIHEAD cmap = gdk_screen_get_system_colormap (gdk_drawable_get_screen (pixmap)); -#else - cmap = gdk_colormap_get_system (); -#endif + g_object_ref (G_OBJECT (cmap)); } }