From 16de6ccd2906b93f79880612b31a12a1e53557c7 Mon Sep 17 00:00:00 2001 From: monsta Date: Sat, 27 Jan 2018 23:29:02 +0300 Subject: require GTK+ 3.22 and GLib 2.50 --- src/core/display.c | 9 --------- src/tools/marco-window-demo.c | 6 ------ src/ui/draw-workspace.c | 7 +------ src/ui/fixedtip.c | 13 ------------- src/ui/metaaccellabel.c | 15 --------------- src/ui/ui.c | 9 --------- 6 files changed, 1 insertion(+), 58 deletions(-) (limited to 'src') diff --git a/src/core/display.c b/src/core/display.c index 006cb6ff..6dd13419 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1438,11 +1438,7 @@ static gboolean maybe_send_event_to_gtk(MetaDisplay* display, XEvent* xevent) GdkEvent* gdk_event = NULL; GdkWindow* gdk_window; Window window; -#if GTK_CHECK_VERSION (3, 20, 0) GdkSeat *seat; -#else - GdkDeviceManager *manager; -#endif GdkDevice *device; switch (xevent->type) @@ -1478,14 +1474,9 @@ static gboolean maybe_send_event_to_gtk(MetaDisplay* display, XEvent* xevent) * (client-side) subwindow for individual menu items. */ -#if GTK_CHECK_VERSION (3, 20, 0) gdk_display = gdk_window_get_display (gdk_window); seat = gdk_display_get_default_seat (gdk_display); device = gdk_seat_get_pointer (seat); -#else - manager = gdk_display_get_device_manager (gdk_display); - device = gdk_device_manager_get_client_pointer (manager); -#endif if (gdk_display_device_is_grabbed(gdk_display, device)) { diff --git a/src/tools/marco-window-demo.c b/src/tools/marco-window-demo.c index 8f8041c4..8b3d8e43 100644 --- a/src/tools/marco-window-demo.c +++ b/src/tools/marco-window-demo.c @@ -663,7 +663,6 @@ dock_cb (GSimpleAction *action, } } -#if GTK_CHECK_VERSION (3, 16, 0) static void override_background_color (GtkWidget *widget, GdkRGBA *rgba) @@ -683,7 +682,6 @@ override_background_color (GtkWidget *widget, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); } -#endif static void desktop_cb (GSimpleAction *action, @@ -707,11 +705,7 @@ desktop_cb (GSimpleAction *action, desktop_color.blue = 0.65; desktop_color.alpha = 1.0; -#if GTK_CHECK_VERSION (3, 16, 0) override_background_color (window, &desktop_color); -#else - gtk_widget_override_background_color (window, 0, &desktop_color); -#endif label = focus_label (window); diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c index bec502a5..e9838be1 100644 --- a/src/ui/draw-workspace.c +++ b/src/ui/draw-workspace.c @@ -65,7 +65,6 @@ get_window_rect (const WnckWindowDisplayInfo *win, rect->height = height; } -#if GTK_CHECK_VERSION (3, 16, 0) static void get_background_color (GtkStyleContext *context, GtkStateFlags state, @@ -84,7 +83,6 @@ get_background_color (GtkStyleContext *context, *color = *c; gdk_rgba_free (c); } -#endif static void draw_window (GtkWidget *widget, @@ -110,11 +108,8 @@ draw_window (GtkWidget *widget, if (is_active) meta_gtk_style_get_light_color (style, state, &color); else -#if GTK_CHECK_VERSION (3, 16, 0) get_background_color (style, state, &color); -#else - gtk_style_context_get_background_color (style, state, &color); -#endif + gdk_cairo_set_source_rgba (cr, &color); cairo_rectangle (cr, diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c index 346b6ffa..b5253cd6 100644 --- a/src/ui/fixedtip.c +++ b/src/ui/fixedtip.c @@ -67,11 +67,7 @@ meta_fixed_tip_show (int root_x, int root_y, { gint w; gint h; -#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *mon_num; -#else - gint mon_num; -#endif GdkRectangle monitor; gint screen_right_edge; @@ -99,12 +95,8 @@ meta_fixed_tip_show (int root_x, int root_y, label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.5); gtk_label_set_yalign (GTK_LABEL (label), 0.5); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); -#endif gtk_widget_show (label); gtk_container_set_border_width (GTK_CONTAINER (tip), 4); @@ -114,13 +106,8 @@ meta_fixed_tip_show (int root_x, int root_y, G_CALLBACK (gtk_widget_destroyed), &tip); } -#if GTK_CHECK_VERSION (3, 22, 0) mon_num = gdk_display_get_monitor_at_point (gdk_screen_get_display (screen), root_x, root_y); gdk_monitor_get_geometry (mon_num, &monitor); -#else - mon_num = gdk_screen_get_monitor_at_point (screen, root_x, root_y); - gdk_screen_get_monitor_geometry (screen, mon_num, &monitor); -#endif screen_right_edge = monitor.x + monitor.width; gtk_label_set_markup (GTK_LABEL (label), markup_text); diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c index 319bceaa..93c16152 100644 --- a/src/ui/metaaccellabel.c +++ b/src/ui/metaaccellabel.c @@ -243,9 +243,6 @@ meta_accel_label_draw (GtkWidget *widget, cairo_t *cr) { MetaAccelLabel *accel_label = META_ACCEL_LABEL (widget); -#if !GTK_CHECK_VERSION (3, 16, 0) - GtkMisc *misc = GTK_MISC (accel_label); -#endif GtkTextDirection direction; int ac_width; GtkAllocation allocation; @@ -264,19 +261,11 @@ meta_accel_label_draw (GtkWidget *widget, PangoLayout *accel_layout; GtkLabel *label = GTK_LABEL (widget); gint x, y, xpad, ypad; -#if GTK_CHECK_VERSION (3, 16, 0) gint margin_start, margin_end, margin_top, margin_bottom; gfloat yalign; -#else - gfloat xalign, yalign; -#endif label_layout = gtk_label_get_layout (GTK_LABEL (accel_label)); -#if GTK_CHECK_VERSION (3, 16, 0) yalign = gtk_label_get_yalign (GTK_LABEL (accel_label)); -#else - gtk_misc_get_alignment (misc, &xalign, &yalign); -#endif cairo_save (cr); @@ -303,7 +292,6 @@ meta_accel_label_draw (GtkWidget *widget, cairo_restore (cr); -#if GTK_CHECK_VERSION (3, 16, 0) margin_start = gtk_widget_get_margin_start (widget); margin_end = gtk_widget_get_margin_end (widget); margin_top = gtk_widget_get_margin_top (widget); @@ -311,9 +299,6 @@ meta_accel_label_draw (GtkWidget *widget, xpad = margin_start + margin_end; ypad = margin_top + margin_bottom; -#else - gtk_misc_get_padding (misc, &xpad, &ypad); -#endif if (direction == GTK_TEXT_DIR_RTL) x = xpad; diff --git a/src/ui/ui.c b/src/ui/ui.c index 5af02ae6..c8b7e93e 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -94,11 +94,7 @@ maybe_redirect_mouse_event (XEvent *xevent) { GdkDisplay *gdisplay; MetaUI *ui; -#if GTK_CHECK_VERSION(3, 20, 0) GdkSeat *seat; -#else - GdkDeviceManager *gmanager; -#endif GdkDevice *gdevice; GdkEvent *gevent; GdkWindow *gdk_window; @@ -130,13 +126,8 @@ maybe_redirect_mouse_event (XEvent *xevent) if (gdk_window == NULL) return FALSE; -#if GTK_CHECK_VERSION(3, 20, 0) seat = gdk_display_get_default_seat (gdisplay); gdevice = gdk_seat_get_pointer (seat); -#else - gmanager = gdk_display_get_device_manager (gdisplay); - gdevice = gdk_device_manager_get_client_pointer (gmanager); -#endif /* If GDK already thinks it has a grab, we better let it see events; this * is the menu-navigation case and events need to get sent to the appropriate -- cgit v1.2.1