Skip to content

Commit b463e8d

Browse files
committed
patch 8.0.0620: checking for HAVE_GTK_MULTIHEAD is not needed
Problem: Since we only support GTK versions that have it, the ckeck for HAVE_GTK_MULTIHEAD is no longer needed. Solution: Remove HAVE_GTK_MULTIHEAD. (Kazunobu Kuriyama)
1 parent 6aa8cea commit b463e8d

7 files changed

Lines changed: 30 additions & 84 deletions

File tree

src/auto/configure

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8997,11 +8997,6 @@ $as_echo "no" >&6; }
89978997
fi
89988998
fi
89998999
if test "x$GUITYPE" = "xGTK"; then
9000-
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
9001-
|| test "0$gtk_minor_version" -ge 2; then
9002-
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
9003-
9004-
fi
90059000
if test -z "$SKIP_GNOME"; then
90069001
{
90079002

@@ -9294,8 +9289,6 @@ $as_echo "no" >&6; }
92949289
SKIP_MOTIF=YES
92959290
GUITYPE=GTK
92969291

9297-
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
9298-
92999292
$as_echo "#define USE_GTK3 1" >>confdefs.h
93009293

93019294
fi

src/config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@
398398
/* Define if you use KDE and want KDE Toolbar support. */
399399
#undef FEAT_KDETOOLBAR
400400

401-
/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
402-
#undef HAVE_GTK_MULTIHEAD
403-
404401
/* Define if your X has own locale library */
405402
#undef X_LOCALE
406403

src/configure.ac

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,10 +2606,6 @@ if test -z "$SKIP_GTK2"; then
26062606
fi
26072607
fi
26082608
if test "x$GUITYPE" = "xGTK"; then
2609-
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
2610-
|| test "0$gtk_minor_version" -ge 2; then
2611-
AC_DEFINE(HAVE_GTK_MULTIHEAD)
2612-
fi
26132609
dnl
26142610
dnl if GTK exists, then check for GNOME.
26152611
dnl
@@ -2658,7 +2654,6 @@ if test -z "$SKIP_GTK3"; then
26582654
SKIP_MOTIF=YES
26592655
GUITYPE=GTK
26602656
AC_SUBST(GTK_LIBNAME)
2661-
AC_DEFINE(HAVE_GTK_MULTIHEAD)
26622657
AC_DEFINE(USE_GTK3)
26632658
fi
26642659
fi

src/gui_beval.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,7 @@ drawBalloon(BalloonEval *beval)
11771177
int x_offset = EVAL_OFFSET_X;
11781178
int y_offset = EVAL_OFFSET_Y;
11791179
PangoLayout *layout;
1180-
# ifdef HAVE_GTK_MULTIHEAD
1181-
# if GTK_CHECK_VERSION(3,22,2)
1180+
# if GTK_CHECK_VERSION(3,22,2)
11821181
GdkRectangle rect;
11831182
GdkMonitor * const mon = gdk_display_get_monitor_at_window(
11841183
gtk_widget_get_display(beval->balloonShell),
@@ -1187,17 +1186,13 @@ drawBalloon(BalloonEval *beval)
11871186

11881187
screen_w = rect.width;
11891188
screen_h = rect.height;
1190-
# else
1189+
# else
11911190
GdkScreen *screen;
11921191

11931192
screen = gtk_widget_get_screen(beval->target);
11941193
gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen);
11951194
screen_w = gdk_screen_get_width(screen);
11961195
screen_h = gdk_screen_get_height(screen);
1197-
# endif
1198-
# else
1199-
screen_w = gdk_screen_width();
1200-
screen_h = gdk_screen_height();
12011196
# endif
12021197
# if !GTK_CHECK_VERSION(3,0,0)
12031198
gtk_widget_ensure_style(beval->balloonShell);

src/gui_gtk_x11.c

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */
113109
enum
@@ -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
29372930
mainwin_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
49934981
gui_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
63366321
gui_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
66996680
gui_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

src/mbyte.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5304,17 +5304,12 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
53045304
{
53055305
GdkEventKey *event;
53065306

5307-
# ifdef HAVE_GTK_MULTIHEAD
53085307
event = (GdkEventKey *)gdk_event_new(GDK_KEY_PRESS);
5309-
# if GTK_CHECK_VERSION(3,0,0)
5308+
# if GTK_CHECK_VERSION(3,0,0)
53105309
g_object_ref(gtk_widget_get_window(gui.drawarea));
53115310
/* unreffed by gdk_event_free() */
5312-
# else
5313-
g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
5314-
# endif
53155311
# else
5316-
event = (GdkEventKey *)g_malloc0((gulong)sizeof(GdkEvent));
5317-
event->type = GDK_KEY_PRESS;
5312+
g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
53185313
# endif
53195314
# if GTK_CHECK_VERSION(3,0,0)
53205315
event->window = gtk_widget_get_window(gui.drawarea);
@@ -5337,11 +5332,7 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
53375332
event->send_event = FALSE;
53385333
gtk_im_context_filter_keypress(xic, event);
53395334

5340-
# ifdef HAVE_GTK_MULTIHEAD
53415335
gdk_event_free((GdkEvent *)event);
5342-
# else
5343-
g_free(event);
5344-
# endif
53455336
}
53465337

53475338
void

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
620,
767769
/**/
768770
619,
769771
/**/

0 commit comments

Comments
 (0)