@@ -102,12 +102,8 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI
102102/*
103103 * Easy-to-use macro for multihead support.
104104 */
105- #ifdef HAVE_GTK_MULTIHEAD
106- # define GET_X_ATOM (atom ) gdk_x11_atom_to_xatom_for_display( \
105+ #define GET_X_ATOM (atom ) gdk_x11_atom_to_xatom_for_display( \
107106 gtk_widget_get_display(gui.mainwin), atom)
108- #else
109- # define GET_X_ATOM (atom ) ((Atom)(atom))
110- #endif
111107
112108/* Selection type distinguishers */
113109enum
@@ -2846,7 +2842,7 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
28462842 /*
28472843 * Cannot handle "XLib-only" windows with gtk event routines, we'll
28482844 * have to change the "server" registration to that of the main window
2849- * If we have not registered a name yet, remember the window
2845+ * If we have not registered a name yet, remember the window.
28502846 */
28512847# if GTK_CHECK_VERSION (3 ,0 ,0 )
28522848 serverChangeRegisteredWindow (GDK_WINDOW_XDISPLAY (mainwin_win ),
@@ -2884,16 +2880,14 @@ create_blank_pointer(void)
28842880 char blank_data [] = { 0x0 };
28852881#endif
28862882
2887- #ifdef HAVE_GTK_MULTIHEAD
2888- # if GTK_CHECK_VERSION (3 ,12 ,0 )
2883+ #if GTK_CHECK_VERSION (3 ,12 ,0 )
28892884 {
28902885 GdkWindow * const win = gtk_widget_get_window (gui .mainwin );
28912886 GdkScreen * const scrn = gdk_window_get_screen (win );
28922887 root_window = gdk_screen_get_root_window (scrn );
28932888 }
2894- # else
2889+ #else
28952890 root_window = gtk_widget_get_root_window (gui .mainwin );
2896- # endif
28972891#endif
28982892
28992893 /* Create a pseudo blank pointer, which is in fact one pixel by one pixel
@@ -2932,7 +2926,6 @@ create_blank_pointer(void)
29322926 return cursor ;
29332927}
29342928
2935- #ifdef HAVE_GTK_MULTIHEAD
29362929 static void
29372930mainwin_screen_changed_cb (GtkWidget * widget ,
29382931 GdkScreen * previous_screen UNUSED ,
@@ -2945,22 +2938,22 @@ mainwin_screen_changed_cb(GtkWidget *widget,
29452938 * Recreate the invisible mouse cursor.
29462939 */
29472940 if (gui .blank_pointer != NULL )
2948- # if GTK_CHECK_VERSION (3 ,0 ,0 )
2941+ #if GTK_CHECK_VERSION (3 ,0 ,0 )
29492942 g_object_unref (G_OBJECT (gui .blank_pointer ));
2950- # else
2943+ #else
29512944 gdk_cursor_unref (gui .blank_pointer );
2952- # endif
2945+ #endif
29532946
29542947 gui .blank_pointer = create_blank_pointer ();
29552948
2956- # if GTK_CHECK_VERSION (3 ,0 ,0 )
2949+ #if GTK_CHECK_VERSION (3 ,0 ,0 )
29572950 if (gui .pointer_hidden && gtk_widget_get_window (gui .drawarea ) != NULL )
29582951 gdk_window_set_cursor (gtk_widget_get_window (gui .drawarea ),
29592952 gui .blank_pointer );
2960- # else
2953+ #else
29612954 if (gui .pointer_hidden && gui .drawarea -> window != NULL )
29622955 gdk_window_set_cursor (gui .drawarea -> window , gui .blank_pointer );
2963- # endif
2956+ #endif
29642957
29652958 /*
29662959 * Create a new PangoContext for this screen, and initialize it
@@ -2978,7 +2971,6 @@ mainwin_screen_changed_cb(GtkWidget *widget,
29782971 gui_set_shellsize (FALSE, FALSE, RESIZE_BOTH );
29792972 }
29802973}
2981- #endif /* HAVE_GTK_MULTIHEAD */
29822974
29832975/*
29842976 * After the drawing area comes up, we calculate all colors and create the
@@ -3907,12 +3899,8 @@ gui_mch_init(void)
39073899 GtkWidget * plug ;
39083900
39093901 /* Use GtkSocket from another app. */
3910- #ifdef HAVE_GTK_MULTIHEAD
39113902 plug = gtk_plug_new_for_display (gdk_display_get_default (),
39123903 gtk_socket_id );
3913- #else
3914- plug = gtk_plug_new (gtk_socket_id );
3915- #endif
39163904#if GTK_CHECK_VERSION (3 ,0 ,0 )
39173905 if (plug != NULL && gtk_plug_get_socket_window (GTK_PLUG (plug )) != NULL )
39183906#else
@@ -3972,10 +3960,10 @@ gui_mch_init(void)
39723960 gtk_signal_connect (GTK_OBJECT (gui .mainwin ), "realize" ,
39733961 GTK_SIGNAL_FUNC (& mainwin_realize ), NULL );
39743962#endif
3975- #ifdef HAVE_GTK_MULTIHEAD
3976- g_signal_connect (G_OBJECT (gui .mainwin ), "screen_changed " ,
3963+
3964+ g_signal_connect (G_OBJECT (gui .mainwin ), "screen-changed " ,
39773965 G_CALLBACK (& mainwin_screen_changed_cb ), NULL );
3978- #endif
3966+
39793967 gui .accel_group = gtk_accel_group_new ();
39803968 gtk_window_add_accel_group (GTK_WINDOW (gui .mainwin ), gui .accel_group );
39813969
@@ -4992,17 +4980,18 @@ gui_mch_set_shellsize(int width, int height,
49924980 void
49934981gui_mch_get_screen_dimensions (int * screen_w , int * screen_h )
49944982{
4995- #ifdef HAVE_GTK_MULTIHEAD
4996- # if GTK_CHECK_VERSION (3 ,22 ,2 )
4983+ #if GTK_CHECK_VERSION (3 ,22 ,2 )
49974984 GdkRectangle rect ;
49984985 GdkMonitor * const mon = gdk_display_get_monitor_at_window (
49994986 gtk_widget_get_display (gui .mainwin ),
50004987 gtk_widget_get_window (gui .mainwin ));
50014988 gdk_monitor_get_geometry (mon , & rect );
50024989
50034990 * screen_w = rect .width ;
4991+ /* Subtract 'guiheadroom' from the height to allow some room for the
4992+ * window manager (task list and window title bar). */
50044993 * screen_h = rect .height - p_ghr ;
5005- # else
4994+ #else
50064995 GdkScreen * screen ;
50074996
50084997 if (gui .mainwin != NULL && gtk_widget_has_screen (gui .mainwin ))
@@ -5011,13 +5000,9 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
50115000 screen = gdk_screen_get_default ();
50125001
50135002 * screen_w = gdk_screen_get_width (screen );
5014- * screen_h = gdk_screen_get_height (screen ) - p_ghr ;
5015- # endif
5016- #else
5017- * screen_w = gdk_screen_width ();
50185003 /* Subtract 'guiheadroom' from the height to allow some room for the
50195004 * window manager (task list and window title bar). */
5020- * screen_h = gdk_screen_height ( ) - p_ghr ;
5005+ * screen_h = gdk_screen_get_height ( screen ) - p_ghr ;
50215006#endif
50225007
50235008 /*
@@ -6335,23 +6320,19 @@ gui_mch_get_display(void)
63356320 void
63366321gui_mch_beep (void )
63376322{
6338- #ifdef HAVE_GTK_MULTIHEAD
63396323 GdkDisplay * display ;
63406324
6341- # if GTK_CHECK_VERSION (3 ,0 ,0 )
6325+ #if GTK_CHECK_VERSION (3 ,0 ,0 )
63426326 if (gui .mainwin != NULL && gtk_widget_get_realized (gui .mainwin ))
6343- # else
6327+ #else
63446328 if (gui .mainwin != NULL && GTK_WIDGET_REALIZED (gui .mainwin ))
6345- # endif
6329+ #endif
63466330 display = gtk_widget_get_display (gui .mainwin );
63476331 else
63486332 display = gdk_display_get_default ();
63496333
63506334 if (display != NULL )
63516335 gdk_display_beep (display );
6352- #else
6353- gdk_beep ();
6354- #endif
63556336}
63566337
63576338 void
@@ -6698,16 +6679,12 @@ gui_mch_wait_for_chars(long wtime)
66986679 void
66996680gui_mch_flush (void )
67006681{
6701- #ifdef HAVE_GTK_MULTIHEAD
6702- # if GTK_CHECK_VERSION (3 ,0 ,0 )
6682+ #if GTK_CHECK_VERSION (3 ,0 ,0 )
67036683 if (gui .mainwin != NULL && gtk_widget_get_realized (gui .mainwin ))
6704- # else
6705- if (gui .mainwin != NULL && GTK_WIDGET_REALIZED (gui .mainwin ))
6706- # endif
6707- gdk_display_flush (gtk_widget_get_display (gui .mainwin ));
67086684#else
6709- gdk_flush (); /* historical misnomer: calls XSync(), not XFlush() */
6685+ if ( gui . mainwin != NULL && GTK_WIDGET_REALIZED ( gui . mainwin ))
67106686#endif
6687+ gdk_display_flush (gtk_widget_get_display (gui .mainwin ));
67116688}
67126689
67136690/*
@@ -7298,12 +7275,8 @@ mch_set_mouse_shape(int shape)
72987275 id = mshape_ids [shape ];
72997276 else
73007277 return ;
7301- # ifdef HAVE_GTK_MULTIHEAD
73027278 c = gdk_cursor_new_for_display (
73037279 gtk_widget_get_display (gui .drawarea ), (GdkCursorType )id );
7304- # else
7305- c = gdk_cursor_new ((GdkCursorType )id );
7306- # endif
73077280# if GTK_CHECK_VERSION (3 ,0 ,0 )
73087281 gdk_window_set_cursor (gtk_widget_get_window (gui .drawarea ), c );
73097282# else
0 commit comments