summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-05 15:07:09 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-05 15:07:09 +0200
commitb463e8d999ec812d656876f313efbeaeed663b45 (patch)
treebb1a8339a15d93724916a8600087aacc97939278
parent6aa8cea46d4179b2617daae034063dd0d8054e35 (diff)
patch 8.0.0620: checking for HAVE_GTK_MULTIHEAD is not neededv8.0.0620
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)
-rwxr-xr-xsrc/auto/configure7
-rw-r--r--src/config.h.in3
-rw-r--r--src/configure.ac5
-rw-r--r--src/gui_beval.c9
-rw-r--r--src/gui_gtk_x11.c75
-rw-r--r--src/mbyte.c13
-rw-r--r--src/version.c2
7 files changed, 30 insertions, 84 deletions
diff --git a/src/auto/configure b/src/auto/configure
index 6dd5bb9ba5..1980a95b20 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -8997,11 +8997,6 @@ $as_echo "no" >&6; }
fi
fi
if test "x$GUITYPE" = "xGTK"; then
- if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
- || test "0$gtk_minor_version" -ge 2; then
- $as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
-
- fi
if test -z "$SKIP_GNOME"; then
{
@@ -9294,8 +9289,6 @@ $as_echo "no" >&6; }
SKIP_MOTIF=YES
GUITYPE=GTK
- $as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
-
$as_echo "#define USE_GTK3 1" >>confdefs.h
fi
diff --git a/src/config.h.in b/src/config.h.in
index f8a23ed78b..a93450710f 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -398,9 +398,6 @@
/* Define if you use KDE and want KDE Toolbar support. */
#undef FEAT_KDETOOLBAR
-/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
-#undef HAVE_GTK_MULTIHEAD
-
/* Define if your X has own locale library */
#undef X_LOCALE
diff --git a/src/configure.ac b/src/configure.ac
index d424550483..1c1b1c7e42 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2606,10 +2606,6 @@ if test -z "$SKIP_GTK2"; then
fi
fi
if test "x$GUITYPE" = "xGTK"; then
- if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
- || test "0$gtk_minor_version" -ge 2; then
- AC_DEFINE(HAVE_GTK_MULTIHEAD)
- fi
dnl
dnl if GTK exists, then check for GNOME.
dnl
@@ -2658,7 +2654,6 @@ if test -z "$SKIP_GTK3"; then
SKIP_MOTIF=YES
GUITYPE=GTK
AC_SUBST(GTK_LIBNAME)
- AC_DEFINE(HAVE_GTK_MULTIHEAD)
AC_DEFINE(USE_GTK3)
fi
fi
diff --git a/src/gui_beval.c b/src/gui_beval.c
index 818a50b2dc..abff1b0916 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -1177,8 +1177,7 @@ drawBalloon(BalloonEval *beval)
int x_offset = EVAL_OFFSET_X;
int y_offset = EVAL_OFFSET_Y;
PangoLayout *layout;
-# ifdef HAVE_GTK_MULTIHEAD
-# if GTK_CHECK_VERSION(3,22,2)
+# if GTK_CHECK_VERSION(3,22,2)
GdkRectangle rect;
GdkMonitor * const mon = gdk_display_get_monitor_at_window(
gtk_widget_get_display(beval->balloonShell),
@@ -1187,17 +1186,13 @@ drawBalloon(BalloonEval *beval)
screen_w = rect.width;
screen_h = rect.height;
-# else
+# else
GdkScreen *screen;
screen = gtk_widget_get_screen(beval->target);
gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen);
screen_w = gdk_screen_get_width(screen);
screen_h = gdk_screen_get_height(screen);
-# endif
-# else
- screen_w = gdk_screen_width();
- screen_h = gdk_screen_height();
# endif
# if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_ensure_style(beval->balloonShell);
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index c00b3d6c49..5837c0b172 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -102,12 +102,8 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI
/*
* Easy-to-use macro for multihead support.
*/
-#ifdef HAVE_GTK_MULTIHEAD
-# define GET_X_ATOM(atom) gdk_x11_atom_to_xatom_for_display( \
+#define GET_X_ATOM(atom) gdk_x11_atom_to_xatom_for_display( \
gtk_widget_get_display(gui.mainwin), atom)
-#else
-# define GET_X_ATOM(atom) ((Atom)(atom))
-#endif
/* Selection type distinguishers */
enum
@@ -2846,7 +2842,7 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
/*
* Cannot handle "XLib-only" windows with gtk event routines, we'll
* have to change the "server" registration to that of the main window
- * If we have not registered a name yet, remember the window
+ * If we have not registered a name yet, remember the window.
*/
# if GTK_CHECK_VERSION(3,0,0)
serverChangeRegisteredWindow(GDK_WINDOW_XDISPLAY(mainwin_win),
@@ -2884,16 +2880,14 @@ create_blank_pointer(void)
char blank_data[] = { 0x0 };
#endif
-#ifdef HAVE_GTK_MULTIHEAD
-# if GTK_CHECK_VERSION(3,12,0)
+#if GTK_CHECK_VERSION(3,12,0)
{
GdkWindow * const win = gtk_widget_get_window(gui.mainwin);
GdkScreen * const scrn = gdk_window_get_screen(win);
root_window = gdk_screen_get_root_window(scrn);
}
-# else
+#else
root_window = gtk_widget_get_root_window(gui.mainwin);
-# endif
#endif
/* Create a pseudo blank pointer, which is in fact one pixel by one pixel
@@ -2932,7 +2926,6 @@ create_blank_pointer(void)
return cursor;
}
-#ifdef HAVE_GTK_MULTIHEAD
static void
mainwin_screen_changed_cb(GtkWidget *widget,
GdkScreen *previous_screen UNUSED,
@@ -2945,22 +2938,22 @@ mainwin_screen_changed_cb(GtkWidget *widget,
* Recreate the invisible mouse cursor.
*/
if (gui.blank_pointer != NULL)
-# if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(G_OBJECT(gui.blank_pointer));
-# else
+#else
gdk_cursor_unref(gui.blank_pointer);
-# endif
+#endif
gui.blank_pointer = create_blank_pointer();
-# if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
if (gui.pointer_hidden && gtk_widget_get_window(gui.drawarea) != NULL)
gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea),
gui.blank_pointer);
-# else
+#else
if (gui.pointer_hidden && gui.drawarea->window != NULL)
gdk_window_set_cursor(gui.drawarea->window, gui.blank_pointer);
-# endif
+#endif
/*
* Create a new PangoContext for this screen, and initialize it
@@ -2978,7 +2971,6 @@ mainwin_screen_changed_cb(GtkWidget *widget,
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
}
}
-#endif /* HAVE_GTK_MULTIHEAD */
/*
* After the drawing area comes up, we calculate all colors and create the
@@ -3907,12 +3899,8 @@ gui_mch_init(void)
GtkWidget *plug;
/* Use GtkSocket from another app. */
-#ifdef HAVE_GTK_MULTIHEAD
plug = gtk_plug_new_for_display(gdk_display_get_default(),
gtk_socket_id);
-#else
- plug = gtk_plug_new(gtk_socket_id);
-#endif
#if GTK_CHECK_VERSION(3,0,0)
if (plug != NULL && gtk_plug_get_socket_window(GTK_PLUG(plug)) != NULL)
#else
@@ -3972,10 +3960,10 @@ gui_mch_init(void)
gtk_signal_connect(GTK_OBJECT(gui.mainwin), "realize",
GTK_SIGNAL_FUNC(&mainwin_realize), NULL);
#endif
-#ifdef HAVE_GTK_MULTIHEAD
- g_signal_connect(G_OBJECT(gui.mainwin), "screen_changed",
+
+ g_signal_connect(G_OBJECT(gui.mainwin), "screen-changed",
G_CALLBACK(&mainwin_screen_changed_cb), NULL);
-#endif
+
gui.accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(gui.mainwin), gui.accel_group);
@@ -4992,8 +4980,7 @@ gui_mch_set_shellsize(int width, int height,
void
gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
{
-#ifdef HAVE_GTK_MULTIHEAD
-# if GTK_CHECK_VERSION(3,22,2)
+#if GTK_CHECK_VERSION(3,22,2)
GdkRectangle rect;
GdkMonitor * const mon = gdk_display_get_monitor_at_window(
gtk_widget_get_display(gui.mainwin),
@@ -5001,8 +4988,10 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
gdk_monitor_get_geometry(mon, &rect);
*screen_w = rect.width;
+ /* Subtract 'guiheadroom' from the height to allow some room for the
+ * window manager (task list and window title bar). */
*screen_h = rect.height - p_ghr;
-# else
+#else
GdkScreen* screen;
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)
screen = gdk_screen_get_default();
*screen_w = gdk_screen_get_width(screen);
- *screen_h = gdk_screen_get_height(screen) - p_ghr;
-# endif
-#else
- *screen_w = gdk_screen_width();
/* Subtract 'guiheadroom' from the height to allow some room for the
* window manager (task list and window title bar). */
- *screen_h = gdk_screen_height() - p_ghr;
+ *screen_h = gdk_screen_get_height(screen) - p_ghr;
#endif
/*
@@ -6335,23 +6320,19 @@ gui_mch_get_display(void)
void
gui_mch_beep(void)
{
-#ifdef HAVE_GTK_MULTIHEAD
GdkDisplay *display;
-# if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
if (gui.mainwin != NULL && gtk_widget_get_realized(gui.mainwin))
-# else
+#else
if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
-# endif
+#endif
display = gtk_widget_get_display(gui.mainwin);
else
display = gdk_display_get_default();
if (display != NULL)
gdk_display_beep(display);
-#else
- gdk_beep();
-#endif
}
void
@@ -6698,16 +6679,12 @@ theend:
void
gui_mch_flush(void)
{
-#ifdef HAVE_GTK_MULTIHEAD
-# if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
if (gui.mainwin != NULL && gtk_widget_get_realized(gui.mainwin))
-# else
- if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
-# endif
- gdk_display_flush(gtk_widget_get_display(gui.mainwin));
#else
- gdk_flush(); /* historical misnomer: calls XSync(), not XFlush() */
+ if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
#endif
+ gdk_display_flush(gtk_widget_get_display(gui.mainwin));
}
/*
@@ -7298,12 +7275,8 @@ mch_set_mouse_shape(int shape)
id = mshape_ids[shape];
else
return;
-# ifdef HAVE_GTK_MULTIHEAD
c = gdk_cursor_new_for_display(
gtk_widget_get_display(gui.drawarea), (GdkCursorType)id);
-# else
- c = gdk_cursor_new((GdkCursorType)id);
-# endif
# if GTK_CHECK_VERSION(3,0,0)
gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea), c);
# else
diff --git a/src/mbyte.c b/src/mbyte.c
index 7396a7c386..71280bdea4 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -5304,17 +5304,12 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
{
GdkEventKey *event;
-# ifdef HAVE_GTK_MULTIHEAD
event = (GdkEventKey *)gdk_event_new(GDK_KEY_PRESS);
-# if GTK_CHECK_VERSION(3,0,0)
+# if GTK_CHECK_VERSION(3,0,0)
g_object_ref(gtk_widget_get_window(gui.drawarea));
/* unreffed by gdk_event_free() */
-# else
- g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
-# endif
# else
- event = (GdkEventKey *)g_malloc0((gulong)sizeof(GdkEvent));
- event->type = GDK_KEY_PRESS;
+ g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
# endif
# if GTK_CHECK_VERSION(3,0,0)
event->window = gtk_widget_get_window(gui.drawarea);
@@ -5337,11 +5332,7 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
event->send_event = FALSE;
gtk_im_context_filter_keypress(xic, event);
-# ifdef HAVE_GTK_MULTIHEAD
gdk_event_free((GdkEvent *)event);
-# else
- g_free(event);
-# endif
}
void
diff --git a/src/version.c b/src/version.c
index 3d91495329..6e232dc03f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 620,
+/**/
619,
/**/
618,