summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-01-29 17:28:30 +0300
committerraveit65 <[email protected]>2018-01-31 11:47:27 +0100
commit26a21fa2cb70a13b7e96ae43d4de825ad7663dc9 (patch)
treed61f2df112ee55e68de510d5c95b2531ba1fa922
parent0045e373ee71efb8ae9979adc4ef88d5dc90b2ea (diff)
downloadcaja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.bz2
caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.xz
require GTK+ 3.22 and GLib 2.50
-rw-r--r--configure.ac6
-rw-r--r--eel/eel-background.c47
-rw-r--r--eel/eel-canvas.c100
-rw-r--r--eel/eel-canvas.h19
-rw-r--r--eel/eel-editable-label.c9
-rw-r--r--eel/eel-gtk-extensions.c4
-rw-r--r--eel/eel-labeled-image.c11
-rw-r--r--eel/eel-wrap-table.c2
-rw-r--r--libcaja-private/caja-autorun.c8
-rw-r--r--libcaja-private/caja-column-chooser.c3
-rw-r--r--libcaja-private/caja-dnd.c12
-rw-r--r--libcaja-private/caja-file-conflict-dialog.c8
-rw-r--r--libcaja-private/caja-icon-container.c69
-rw-r--r--libcaja-private/caja-mime-application-chooser.c6
-rw-r--r--libcaja-private/caja-open-with-dialog.c11
-rw-r--r--libcaja-private/caja-progress-info.c8
-rw-r--r--libcaja-private/caja-tree-view-drag-dest.c14
-rw-r--r--src/caja-application.c4
-rw-r--r--src/caja-bookmarks-window.c6
-rw-r--r--src/caja-connect-server-dialog.c46
-rw-r--r--src/caja-desktop-window.c8
-rw-r--r--src/caja-file-management-properties.c6
-rw-r--r--src/caja-history-sidebar.c3
-rw-r--r--src/caja-image-properties-page.c4
-rw-r--r--src/caja-location-bar.c4
-rw-r--r--src/caja-location-dialog.c6
-rw-r--r--src/caja-main.c5
-rw-r--r--src/caja-notebook.c9
-rw-r--r--src/caja-notes-viewer.c3
-rw-r--r--src/caja-pathbar.c8
-rw-r--r--src/caja-places-sidebar.c3
-rw-r--r--src/caja-property-browser.c18
-rw-r--r--src/caja-query-editor.c2
-rw-r--r--src/caja-view-as-action.c4
-rw-r--r--src/caja-window-menus.c8
-rw-r--r--src/caja-window.c11
-rw-r--r--src/caja-x-content-bar.c4
-rw-r--r--src/caja-zoom-control.c27
-rw-r--r--src/file-manager/fm-desktop-icon-view.c42
-rw-r--r--src/file-manager/fm-directory-view.c16
-rw-r--r--src/file-manager/fm-ditem-page.c4
-rw-r--r--src/file-manager/fm-icon-view.c8
-rw-r--r--src/file-manager/fm-list-view.c4
-rw-r--r--src/file-manager/fm-properties-window.c17
-rw-r--r--src/file-manager/fm-tree-view.c2
-rw-r--r--test/test-eel-editable-label.c8
46 files changed, 24 insertions, 603 deletions
diff --git a/configure.ac b/configure.ac
index 27ad9e11..d49f62f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,11 @@ AC_PREREQ(2.54)
dnl ===========================================================================
-m4_define(glib_minver, 2.36.0)
-m4_define(gio_minver, 2.26.0)
+m4_define(glib_minver, 2.50.0)
+m4_define(gio_minver, 2.50.0)
m4_define(mate_desktop_minver, 1.17.3)
m4_define(pango_minver, 1.1.2)
-m4_define(gtk_minver, 3.14.0)
+m4_define(gtk_minver, 3.22.0)
m4_define(xml_minver, 2.4.7)
m4_define(exif_minver, 0.6.14)
m4_define(exempi_minver, 1.99.5)
diff --git a/eel/eel-background.c b/eel/eel-background.c
index 8de791ec..e9b4b2cf 100644
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -80,9 +80,7 @@ struct EelBackgroundDetails
gboolean is_active;
};
-#if GTK_CHECK_VERSION (3, 22, 0)
static GList *desktop_bg_objects = NULL;
-#endif
static void
free_fade (EelBackground *self)
@@ -131,14 +129,12 @@ eel_background_finalize (GObject *object)
free_background_surface (self);
free_fade (self);
-#if GTK_CHECK_VERSION (3, 22, 0)
if (self->details->is_desktop)
{
desktop_bg_objects = g_list_remove (desktop_bg_objects,
G_OBJECT (self));
}
-#endif
G_OBJECT_CLASS (eel_background_parent_class)->finalize (object);
}
@@ -496,22 +492,8 @@ fade_to_surface (EelBackground *self,
if (!mate_bg_crossfade_is_started (self->details->fade))
{
-#if GTK_CHECK_VERSION (3, 22, 0)
mate_bg_crossfade_start_widget (self->details->fade, widget);
-#else
- GdkWindow *window;
-
- if (EEL_IS_CANVAS (widget))
- {
- window = gtk_layout_get_bin_window (GTK_LAYOUT (widget));
- }
- else
- {
- window = gtk_widget_get_window (widget);
- }
- mate_bg_crossfade_start (self->details->fade, window);
-#endif
if (self->details->is_desktop)
{
g_signal_connect (self->details->fade,
@@ -558,22 +540,6 @@ eel_background_set_up_widget (EelBackground *self)
if (self->details->is_desktop)
{
-#if !GTK_CHECK_VERSION (3, 22, 0)
- if (self->details->bg_surface != NULL)
- {
- cairo_pattern_t *pattern =
- cairo_pattern_create_for_surface (self->details->bg_surface);
- gdk_window_set_background_pattern (window, pattern);
- cairo_pattern_destroy (pattern);
- }
- else
- {
- GdkRGBA color = self->details->default_color;
- make_color_inactive (self, &color);
- gdk_window_set_background_rgba (window, &color);
- }
- gdk_window_invalidate_rect (window, NULL, TRUE);
-#endif
set_root_surface (self, window, gtk_widget_get_screen (widget));
}
}
@@ -748,9 +714,7 @@ eel_get_widget_background (GtkWidget *widget)
{
EelBackground *self;
gpointer data;
-#if GTK_CHECK_VERSION (3, 22, 0)
GList *l;
-#endif
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
@@ -761,7 +725,7 @@ eel_get_widget_background (GtkWidget *widget)
g_assert (EEL_IS_BACKGROUND (data));
return data;
}
-#if GTK_CHECK_VERSION (3, 22, 0)
+
/* Check for an existing desktop window background. */
for (l = desktop_bg_objects; l != NULL; l = l->next)
{
@@ -772,7 +736,6 @@ eel_get_widget_background (GtkWidget *widget)
return self;
}
}
-#endif
self = eel_background_new ();
self->details->widget = widget;
@@ -887,14 +850,12 @@ eel_background_set_desktop (EelBackground *self,
if (is_desktop)
{
-#if GTK_CHECK_VERSION (3, 22, 0)
self->details->widget =
gtk_widget_get_toplevel (self->details->front_widget);
desktop_bg_objects = g_list_prepend (desktop_bg_objects,
G_OBJECT (self));
-#endif
if (gtk_widget_get_realized (self->details->widget))
{
widget_realized_setup (self->details->widget, self);
@@ -902,11 +863,9 @@ eel_background_set_desktop (EelBackground *self,
}
else
{
-#if GTK_CHECK_VERSION (3, 22, 0)
desktop_bg_objects = g_list_remove (desktop_bg_objects,
G_OBJECT (self));
self->details->widget = self->details->front_widget;
-#endif
}
}
@@ -937,12 +896,8 @@ eel_background_is_dark (EelBackground *self)
/* only check for the background on the 0th monitor */
GdkScreen *screen = gdk_screen_get_default ();
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkDisplay *display = gdk_screen_get_display (screen);
gdk_monitor_get_geometry (gdk_display_get_monitor (display, 0), &rect);
-#else
- gdk_screen_get_monitor_geometry (screen, 0, &rect);
-#endif
return mate_bg_is_dark (self->details->bg, rect.width, rect.height);
}
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c
index 6e01bf2e..340f25e3 100644
--- a/eel/eel-canvas.c
+++ b/eel/eel-canvas.c
@@ -332,11 +332,7 @@ eel_canvas_item_dispose (GObject *object)
item->canvas->need_repick = TRUE;
}
-#if GTK_CHECK_VERSION (3, 20, 0)
eel_canvas_item_ungrab (item);
-#else
- eel_canvas_item_ungrab (item, GDK_CURRENT_TIME);
-#endif
if (item == item->canvas->focused_item)
item->canvas->focused_item = NULL;
@@ -869,7 +865,6 @@ eel_canvas_item_hide (EelCanvasItem *item)
}
}
-#if GTK_CHECK_VERSION (3, 20, 0)
/*
* Prepare the window for grabbing, i.e. show it.
*/
@@ -897,44 +892,15 @@ seat_grab_prepare_window (GdkSeat *seat,
* returns %GDK_GRAB_NOT_VIEWABLE. Else, it returns the result of calling
* gdk_seat_grab().
**/
-#else
-/**
- * eel_canvas_item_grab:
- * @item: A canvas item.
- * @event_mask: Mask of events that will be sent to this item.
- * @cursor: If non-NULL, the cursor that will be used while the grab is active.
- * @etime: The timestamp required for grabbing the mouse, or GDK_CURRENT_TIME.
- *
- * Specifies that all events that match the specified event mask should be sent
- * to the specified item, and also grabs the mouse by calling
- * gdk_pointer_grab(). The event mask is also used when grabbing the pointer.
- * If @cursor is not NULL, then that cursor is used while the grab is active.
- * The @etime parameter is the timestamp required for grabbing the mouse.
- *
- * Return value: If an item was already grabbed, it returns %GDK_GRAB_ALREADY_GRABBED. If
- * the specified item was hidden by calling eel_canvas_item_hide(), then it
- * returns %GDK_GRAB_NOT_VIEWABLE. Else, it returns the result of calling
- * gdk_pointer_grab().
- **/
-#endif
GdkGrabStatus
eel_canvas_item_grab (EelCanvasItem *item,
GdkEventMask event_mask,
GdkCursor *cursor,
-#if GTK_CHECK_VERSION (3, 20, 0)
const GdkEvent *event)
{
GdkGrabStatus retval;
GdkDisplay *display;
GdkSeat *seat;
-#else
- guint32 timestamp)
-{
- GdkGrabStatus retval;
- GdkDisplay *display;
- GdkDeviceManager *manager;
- GdkDevice *device;
-#endif
g_return_val_if_fail (EEL_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE);
g_return_val_if_fail (gtk_widget_get_mapped (GTK_WIDGET (item->canvas)),
@@ -947,7 +913,6 @@ eel_canvas_item_grab (EelCanvasItem *item,
return GDK_GRAB_NOT_VIEWABLE;
display = gtk_widget_get_display (GTK_WIDGET (item->canvas));
-#if GTK_CHECK_VERSION (3, 20, 0)
seat = gdk_display_get_default_seat (display);
retval = gdk_seat_grab (seat,
@@ -958,18 +923,6 @@ eel_canvas_item_grab (EelCanvasItem *item,
event,
seat_grab_prepare_window,
NULL);
-#else
- manager = gdk_display_get_device_manager (display);
- device = gdk_device_manager_get_client_pointer (manager);
-
- retval = gdk_device_grab (device,
- gtk_layout_get_bin_window (GTK_LAYOUT (item->canvas)),
- GDK_OWNERSHIP_NONE,
- FALSE,
- event_mask,
- cursor,
- timestamp);
-#endif
if (retval != GDK_GRAB_SUCCESS)
return retval;
@@ -981,7 +934,6 @@ eel_canvas_item_grab (EelCanvasItem *item,
return retval;
}
-#if GTK_CHECK_VERSION (3, 20, 0)
/**
* eel_canvas_item_ungrab:
* @item: A canvas item that holds a grab.
@@ -989,18 +941,7 @@ eel_canvas_item_grab (EelCanvasItem *item,
* Ungrabs the item, which must have been grabbed in the canvas, and ungrabs the
* seat.
**/
-#else
-/**
- * eel_canvas_item_ungrab:
- * @item: A canvas item that holds a grab.
- * @etime: The timestamp for ungrabbing the mouse.
- *
- * Ungrabs the item, which must have been grabbed in the canvas, and ungrabs the
- * mouse.
- **/
-#endif
void
-#if GTK_CHECK_VERSION (3, 20, 0)
eel_canvas_item_ungrab (EelCanvasItem *item)
{
GdkDisplay *display;
@@ -1017,26 +958,6 @@ eel_canvas_item_ungrab (EelCanvasItem *item)
item->canvas->grabbed_item = NULL;
gdk_seat_ungrab (seat);
}
-#else
-eel_canvas_item_ungrab (EelCanvasItem *item, guint32 etime)
-{
- GdkDisplay *display;
- GdkDeviceManager *manager;
- GdkDevice *device;
-
- g_return_if_fail (EEL_IS_CANVAS_ITEM (item));
-
- if (item->canvas->grabbed_item != item)
- return;
-
- display = gtk_widget_get_display (GTK_WIDGET (item->canvas));
- manager = gdk_display_get_device_manager (display);
- device = gdk_device_manager_get_client_pointer (manager);
-
- item->canvas->grabbed_item = NULL;
- gdk_device_ungrab (device, etime);
-}
-#endif
/**
* eel_canvas_item_w2i:
@@ -2226,11 +2147,7 @@ shutdown_transients (EelCanvas *canvas)
if (canvas->grabbed_item)
{
-#if GTK_CHECK_VERSION (3, 20, 0)
eel_canvas_item_ungrab (canvas->grabbed_item);
-#else
- eel_canvas_item_ungrab (canvas->grabbed_item, GDK_CURRENT_TIME);
-#endif
}
remove_idle (canvas);
@@ -2623,32 +2540,15 @@ emit_event (EelCanvas *canvas, GdkEvent *event)
break;
case GDK_MOTION_NOTIFY:
-#if !GTK_CHECK_VERSION (3, 20, 0)
- eel_canvas_window_to_world (canvas,
- ev.motion.x, ev.motion.y,
- &ev.motion.x, &ev.motion.y);
- break;
-#endif
-
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
-#if GTK_CHECK_VERSION (3, 20, 0)
case GDK_BUTTON_RELEASE:
-#endif
eel_canvas_window_to_world (canvas,
ev.motion.x, ev.motion.y,
&ev.motion.x, &ev.motion.y);
break;
-#if !GTK_CHECK_VERSION (3, 20, 0)
- case GDK_BUTTON_RELEASE:
- eel_canvas_window_to_world (canvas,
- ev.motion.x, ev.motion.y,
- &ev.motion.x, &ev.motion.y);
- break;
-#endif
-
default:
break;
}
diff --git a/eel/eel-canvas.h b/eel/eel-canvas.h
index c0cbd301..8830e741 100644
--- a/eel/eel-canvas.h
+++ b/eel/eel-canvas.h
@@ -247,38 +247,19 @@ extern "C" {
*/
void eel_canvas_item_hide (EelCanvasItem *item);
-#if GTK_CHECK_VERSION (3, 20, 0)
/* Grab the seat for the specified item. Only the events in event_mask will be
* reported. If cursor is non-NULL, it will be used during the duration of the
* grab. event is the event, triggering the grab. Returns the same values as gdk_seat_grab().
*/
-#else
- /* Grab the mouse for the specified item. Only the events in event_mask will be
- * reported. If cursor is non-NULL, it will be used during the duration of the
- * grab. Time is a proper X event time parameter. Returns the same values as
- * XGrabPointer().
- */
-#endif
GdkGrabStatus eel_canvas_item_grab (EelCanvasItem *item,
GdkEventMask event_mask,
GdkCursor *cursor,
-#if GTK_CHECK_VERSION (3, 20, 0)
const GdkEvent* event);
-#else
- guint32 etime);
-#endif
-#if GTK_CHECK_VERSION (3, 20, 0)
/* Ungrabs the seat -- the specified item must be the same that was passed to
* eel_canvas_item_grab().
*/
void eel_canvas_item_ungrab (EelCanvasItem *item);
-#else
- /* Ungrabs the mouse -- the specified item must be the same that was passed to
- * eel_canvas_item_grab(). Time is a proper X event time parameter.
- */
- void eel_canvas_item_ungrab (EelCanvasItem *item, guint32 etime);
-#endif
/* These functions convert from a coordinate system to another. "w" is world
* coordinates and "i" is item coordinates.
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 8b98a273..7cdbc491 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -40,11 +40,6 @@
#include <gdk/gdkkeysyms.h>
-/* g_memmove is removed in glib 2.40 */
-#if GLIB_CHECK_VERSION (2, 39, 0)
-#define g_memmove memmove
-#endif
-
enum
{
MOVE_CURSOR,
@@ -2282,7 +2277,7 @@ eel_editable_label_delete_text (EelEditableLabel *label,
if (start_pos < end_pos)
{
- g_memmove (label->text + start_pos, label->text + end_pos, label->n_bytes + 1 - end_pos);
+ memmove (label->text + start_pos, label->text + end_pos, label->n_bytes + 1 - end_pos);
label->n_bytes -= (end_pos - start_pos);
anchor = label->selection_anchor;
@@ -2325,7 +2320,7 @@ eel_editable_label_insert_text (EelEditableLabel *label,
g_object_freeze_notify (G_OBJECT (label));
- g_memmove (label->text + *index + new_text_length, label->text + *index, label->n_bytes - *index);
+ memmove (label->text + *index + new_text_length, label->text + *index, label->n_bytes - *index);
memcpy (label->text + *index, new_text, new_text_length);
label->n_bytes += new_text_length;
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index 1fd156c0..c3cff2f5 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -448,11 +448,7 @@ eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
label = gtk_label_new (details_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (expander), label);
gtk_box_pack_start (GTK_BOX (content_area), expander, FALSE, FALSE, 0);
diff --git a/eel/eel-labeled-image.c b/eel/eel-labeled-image.c
index d58d808e..1928d064 100644
--- a/eel/eel-labeled-image.c
+++ b/eel/eel-labeled-image.c
@@ -1058,13 +1058,8 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
if (labeled_image->details->fill)
{
-#if GTK_CHECK_VERSION (3, 16, 0)
x_alignment = gtk_label_get_xalign (GTK_LABEL (labeled_image->details->label));
y_alignment = gtk_label_get_yalign (GTK_LABEL (labeled_image->details->label));
-#else
- gtk_misc_get_alignment (GTK_MISC (labeled_image->details->label),
- &x_alignment, &y_alignment);
-#endif
/* Only the label is shown */
if (!labeled_image_show_image (labeled_image))
@@ -1100,14 +1095,8 @@ labeled_image_update_alignments (EelLabeledImage *labeled_image)
}
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (labeled_image->details->label), x_alignment);
gtk_label_set_yalign (GTK_LABEL (labeled_image->details->label), y_alignment);
-#else
- gtk_misc_set_alignment (GTK_MISC (labeled_image->details->label),
- x_alignment,
- y_alignment);
-#endif
}
}
diff --git a/eel/eel-wrap-table.c b/eel/eel-wrap-table.c
index ac626a42..793d2290 100644
--- a/eel/eel-wrap-table.c
+++ b/eel/eel-wrap-table.c
@@ -1101,9 +1101,7 @@ eel_scrolled_wrap_table_new (gboolean homogeneous,
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled_window), FALSE);
-#endif
viewport = gtk_viewport_new (gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled_window)),
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c
index 9a1ac819..22ed18df 100644
--- a/libcaja-private/caja-autorun.c
+++ b/libcaja-private/caja-autorun.c
@@ -1085,11 +1085,7 @@ show_dialog:
g_free (markup);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 50);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
label = gtk_label_new (NULL);
@@ -1100,11 +1096,7 @@ show_dialog:
g_free (markup);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 50);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
data = g_new0 (AutorunDialogData, 1);
diff --git a/libcaja-private/caja-column-chooser.c b/libcaja-private/caja-column-chooser.c
index 32906a38..6574ae52 100644
--- a/libcaja-private/caja-column-chooser.c
+++ b/libcaja-private/caja-column-chooser.c
@@ -280,9 +280,8 @@ add_tree_view (CajaColumnChooser *chooser)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled), FALSE);
-#endif
+
gtk_widget_show (GTK_WIDGET (scrolled));
gtk_container_add (GTK_CONTAINER (scrolled), view);
diff --git a/libcaja-private/caja-dnd.c b/libcaja-private/caja-dnd.c
index cecb0ec1..64a59966 100644
--- a/libcaja-private/caja-dnd.c
+++ b/libcaja-private/caja-dnd.c
@@ -911,30 +911,18 @@ void
caja_drag_autoscroll_calculate_delta (GtkWidget *widget, float *x_scroll_delta, float *y_scroll_delta)
{
GtkAllocation allocation;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *pointer;
-#else
- GdkDeviceManager *manager;
- GdkDevice *pointer;
-#endif
int x, y;
g_assert (GTK_IS_WIDGET (widget));
-#if GTK_CHECK_VERSION (3, 20, 0)
display = gtk_widget_get_display (widget);
seat = gdk_display_get_default_seat (display);
pointer = gdk_seat_get_pointer (seat);
gdk_window_get_device_position (gtk_widget_get_window (widget), pointer,
&x, &y, NULL);
-#else
- manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
- pointer = gdk_device_manager_get_client_pointer (manager);
- gdk_window_get_device_position (gtk_widget_get_window (widget), pointer,
- &x, &y, NULL);
-#endif
/* Find out if we are anywhere close to the tree view edges
* to see if we need to autoscroll.
diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c
index 03a9dfb6..003bcf76 100644
--- a/libcaja-private/caja-file-conflict-dialog.c
+++ b/libcaja-private/caja-file-conflict-dialog.c
@@ -211,11 +211,7 @@ file_list_ready_cb (GList *files,
label = gtk_label_new (primary_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (details->titles_vbox),
label, FALSE, FALSE, 0);
gtk_widget_show (label);
@@ -231,11 +227,7 @@ file_list_ready_cb (GList *files,
label = gtk_label_new (secondary_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 60);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (details->titles_vbox),
label, FALSE, FALSE, 0);
gtk_widget_show (label);
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index 59e8ab83..70671afa 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -2719,10 +2719,8 @@ rubberband_timeout_callback (gpointer data)
double world_x, world_y;
int x_scroll, y_scroll;
int adj_x, adj_y;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkDisplay *display;
GdkSeat *seat;
-#endif
gboolean adj_changed;
GtkAllocation allocation;
@@ -2752,20 +2750,12 @@ rubberband_timeout_callback (gpointer data)
band_info->last_adj_y = adj_y;
adj_changed = TRUE;
}
-#if GTK_CHECK_VERSION (3, 20, 0)
display = gtk_widget_get_display (widget);
seat = gdk_display_get_default_seat (display);
gdk_window_get_device_position (gtk_widget_get_window (widget),
gdk_seat_get_pointer (seat),
&x, &y, NULL);
-#else
- gdk_window_get_device_position (gtk_widget_get_window (widget),
- gdk_device_manager_get_client_pointer (
- gdk_display_get_device_manager (
- gtk_widget_get_display (widget))),
- &x, &y, NULL);
-#endif
if (x < 0)
{
@@ -2935,21 +2925,12 @@ start_rubberbanding (CajaIconContainer *container,
(GDK_POINTER_MOTION_MASK
| GDK_BUTTON_RELEASE_MASK
| GDK_SCROLL_MASK),
-#if GTK_CHECK_VERSION (3, 20, 0)
NULL,
(GdkEvent *)event);
-#else
- NULL, event->time);
-#endif
}
static void
-#if GTK_CHECK_VERSION (3, 20, 0)
stop_rubberbanding (CajaIconContainer *container)
-#else
-stop_rubberbanding (CajaIconContainer *container,
- guint32 time)
-#endif
{
CajaIconRubberbandInfo *band_info;
GList *icons;
@@ -2963,11 +2944,7 @@ stop_rubberbanding (CajaIconContainer *container,
band_info->active = FALSE;
/* Destroy this canvas item; the parent will unref it. */
-#if GTK_CHECK_VERSION (3, 20, 0)
eel_canvas_item_ungrab (band_info->selection_rectangle);
-#else
- eel_canvas_item_ungrab (band_info->selection_rectangle, time);
-#endif
eel_canvas_item_destroy (band_info->selection_rectangle);
band_info->selection_rectangle = NULL;
@@ -4605,14 +4582,7 @@ realize (GtkWidget *widget)
GTK_WIDGET_CLASS (caja_icon_container_parent_class)->realize (widget);
container = CAJA_ICON_CONTAINER (widget);
-#if !GTK_CHECK_VERSION (3, 22, 0)
- /* Ensure that the desktop window is native so the background
- set on it is drawn by X. */
- if (container->details->is_desktop)
- {
- gdk_x11_window_get_xid (gtk_layout_get_bin_window (GTK_LAYOUT (widget)));
- }
-#endif
+
/* Set up DnD. */
caja_icon_dnd_init (container);
@@ -4898,12 +4868,8 @@ clear_drag_state (CajaIconContainer *container)
}
static gboolean
-#if GTK_CHECK_VERSION (3, 20, 0)
start_stretching (CajaIconContainer *container,
GdkEvent *event)
-#else
-start_stretching (CajaIconContainer *container)
-#endif
{
CajaIconContainerDetails *details;
CajaIcon *icon;
@@ -4961,11 +4927,8 @@ start_stretching (CajaIconContainer *container)
(GDK_POINTER_MOTION_MASK
| GDK_BUTTON_RELEASE_MASK),
cursor,
-#if GTK_CHECK_VERSION (3, 20, 0)
event);
-#else
- GDK_CURRENT_TIME);
-#endif
+
if (cursor)
g_object_unref (cursor);
@@ -5073,12 +5036,7 @@ keyboard_stretching (CajaIconContainer *container,
static void
ungrab_stretch_icon (CajaIconContainer *container)
{
-#if GTK_CHECK_VERSION (3, 20, 0)
eel_canvas_item_ungrab (EEL_CANVAS_ITEM (container->details->stretch_icon->item));
-#else
- eel_canvas_item_ungrab (EEL_CANVAS_ITEM (container->details->stretch_icon->item),
- GDK_CURRENT_TIME);
-#endif
}
static void
@@ -5161,11 +5119,7 @@ button_release_event (GtkWidget *widget,
if (event->button == RUBBERBAND_BUTTON && details->rubberband_info.active)
{
-#if GTK_CHECK_VERSION (3, 20, 0)
stop_rubberbanding (container);
-#else
- stop_rubberbanding (container, event->time);
-#endif
return TRUE;
}
@@ -5288,25 +5242,16 @@ caja_icon_container_search_position_func (CajaIconContainer *container,
GdkWindow *cont_window;
GdkScreen *screen;
GtkRequisition requisition;
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor_num;
-#else
- gint monitor_num;
-#endif
GdkRectangle monitor;
cont_window = gtk_widget_get_window (GTK_WIDGET (container));
screen = gdk_window_get_screen (cont_window);
-#if GTK_CHECK_VERSION (3, 22, 0)
monitor_num = gdk_display_get_monitor_at_window (gdk_screen_get_display (screen),
cont_window);
gdk_monitor_get_geometry (monitor_num, &monitor);
-#else
- monitor_num = gdk_screen_get_monitor_at_window (screen, cont_window);
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
-#endif
gtk_widget_realize (search_dialog);
@@ -6180,12 +6125,7 @@ grab_notify_cb (GtkWidget *widget,
* up (e.g. authentication or an error). Stop
* the rubberbanding so that we can handle the
* dialog. */
-#if GTK_CHECK_VERSION (3, 20, 0)
stop_rubberbanding (container);
-#else
- stop_rubberbanding (container,
- GDK_CURRENT_TIME);
-#endif
}
}
@@ -6930,13 +6870,8 @@ handle_icon_button_press (CajaIconContainer *container,
*/
if (icon == container->details->stretch_icon)
{
-#if GTK_CHECK_VERSION (3, 20, 0)
if (start_stretching (container, (GdkEvent *)event))
{
-#else
- if (start_stretching (container))
- {
-#endif
return TRUE;
}
}
diff --git a/libcaja-private/caja-mime-application-chooser.c b/libcaja-private/caja-mime-application-chooser.c
index 556c0499..4bd322ac 100644
--- a/libcaja-private/caja-mime-application-chooser.c
+++ b/libcaja-private/caja-mime-application-chooser.c
@@ -384,11 +384,7 @@ caja_mime_application_chooser_init (CajaMimeApplicationChooser *chooser)
gtk_box_set_homogeneous (GTK_BOX (chooser), FALSE);
chooser->details->label = gtk_label_new ("");
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (chooser->details->label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (chooser->details->label), 0.0, 0.5);
-#endif
gtk_label_set_line_wrap (GTK_LABEL (chooser->details->label), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (chooser->details->label),
PANGO_WRAP_WORD_CHAR);
@@ -404,9 +400,7 @@ caja_mime_application_chooser_init (CajaMimeApplicationChooser *chooser)
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled), FALSE);
-#endif
gtk_widget_show (scrolled);
gtk_box_pack_start (GTK_BOX (chooser), scrolled, TRUE, TRUE, 6);
diff --git a/libcaja-private/caja-open-with-dialog.c b/libcaja-private/caja-open-with-dialog.c
index 4ce9f071..bbbdcf34 100644
--- a/libcaja-private/caja-open-with-dialog.c
+++ b/libcaja-private/caja-open-with-dialog.c
@@ -851,11 +851,7 @@ caja_open_with_dialog_init (CajaOpenWithDialog *dialog)
gtk_box_pack_start (GTK_BOX (vbox), vbox2, TRUE, TRUE, 0);
dialog->details->label = gtk_label_new ("");
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (dialog->details->label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (dialog->details->label), 0.0, 0.5);
-#endif
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), dialog->details->label,
FALSE, FALSE, 0);
@@ -870,9 +866,8 @@ caja_open_with_dialog_init (CajaOpenWithDialog *dialog)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled_window), FALSE);
-#endif
+
dialog->details->program_list = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (dialog->details->program_list),
FALSE);
@@ -881,11 +876,7 @@ caja_open_with_dialog_init (CajaOpenWithDialog *dialog)
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, 0);
dialog->details->desc_label = gtk_label_new (_("Select an application to view its description."));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (dialog->details->desc_label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (dialog->details->desc_label), 0.0, 0.5);
-#endif
gtk_label_set_justify (GTK_LABEL (dialog->details->desc_label), GTK_JUSTIFY_LEFT);
gtk_label_set_max_width_chars (GTK_LABEL (dialog->details->desc_label), 54);
gtk_label_set_line_wrap (GTK_LABEL (dialog->details->desc_label), TRUE);
diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c
index 4efbc41e..32125733 100644
--- a/libcaja-private/caja-progress-info.c
+++ b/libcaja-private/caja-progress-info.c
@@ -800,11 +800,7 @@ progress_widget_new (CajaProgressInfo *info)
gtk_widget_set_size_request (label, 500, -1);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox),
label,
TRUE, FALSE,
@@ -855,11 +851,7 @@ progress_widget_new (CajaProgressInfo *info)
0);
label = gtk_label_new ("details");
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (vbox),
label,
diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c
index 3cc8ef61..c1c8ad15 100644
--- a/libcaja-private/caja-tree-view-drag-dest.c
+++ b/libcaja-private/caja-tree-view-drag-dest.c
@@ -102,14 +102,9 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
{
GdkRectangle visible_rect;
GtkAdjustment *vadjustment;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *pointer;
-#else
- GdkDeviceManager *manager;
- GdkDevice *pointer;
-#endif
GdkWindow *window;
int y;
int offset;
@@ -117,7 +112,6 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
window = gtk_tree_view_get_bin_window (tree_view);
-#if GTK_CHECK_VERSION (3, 20, 0)
vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
display = gtk_widget_get_display (GTK_WIDGET (tree_view));
@@ -125,14 +119,6 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
pointer = gdk_seat_get_pointer (seat);
gdk_window_get_device_position (window, pointer,
NULL, &y, NULL);
-#else
- vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
-
- manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (tree_view)));
- pointer = gdk_device_manager_get_client_pointer (manager);
- gdk_window_get_device_position (window, pointer,
- NULL, &y, NULL);
-#endif
y += gtk_adjustment_get_value (vadjustment);
diff --git a/src/caja-application.c b/src/caja-application.c
index 3f558901..77a323a6 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -2208,11 +2208,7 @@ init_icons_and_styles (void)
/* add our desktop CSS provider, ensures the desktop background does not get covered */
provider = gtk_css_provider_new ();
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop.css", &error);
-#else
- gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop-3.14.css", &error);
-#endif
if (error != NULL) {
g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message);
diff --git a/src/caja-bookmarks-window.c b/src/caja-bookmarks-window.c
index 0c122dad..60254cfd 100644
--- a/src/caja-bookmarks-window.c
+++ b/src/caja-bookmarks-window.c
@@ -144,15 +144,9 @@ caja_bookmarks_window_response_callback (GtkDialog *dialog,
{
GError *error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-user-guide/goscaja-36",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "help:mate-user-guide/goscaja-36",
- gtk_get_current_event_time (), &error);
-#endif
if (error)
{
diff --git a/src/caja-connect-server-dialog.c b/src/caja-connect-server-dialog.c
index 05e6875f..13fc3c58 100644
--- a/src/caja-connect-server-dialog.c
+++ b/src/caja-connect-server-dialog.c
@@ -710,15 +710,9 @@ connect_dialog_response_cb (CajaConnectServerDialog *dialog,
break;
case GTK_RESPONSE_HELP :
error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-user-guide/caja-server-connect",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "help:mate-user-guide/caja-server-connect",
- gtk_get_current_event_time (), &error);
-#endif
if (error)
{
eel_show_error_dialog (_("There was an error displaying help."), error->message,
@@ -880,11 +874,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
str = g_strdup_printf ("<b>%s</b>", _("Server Details"));
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6);
gtk_widget_show (label);
@@ -902,11 +892,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* first row: server entry + port spinbutton */
label = gtk_label_new_with_mnemonic (_("_Server:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
gtk_widget_show (label);
@@ -924,11 +910,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* port */
label = gtk_label_new_with_mnemonic (_("_Port:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@@ -946,11 +928,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* second row: type combobox */
label = gtk_label_new (_("Type:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
gtk_widget_show (label);
@@ -1023,11 +1001,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* third row: share entry */
label = gtk_label_new (_("Share:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
dialog->details->share_entry = gtk_entry_new ();
@@ -1039,11 +1013,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* fourth row: folder entry */
label = gtk_label_new (_("Folder:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
gtk_widget_show (label);
dialog->details->folder_entry = gtk_entry_new ();
@@ -1058,11 +1028,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
str = g_strdup_printf ("<b>%s</b>", _("User Details"));
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6);
grid = gtk_grid_new ();
@@ -1080,11 +1046,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* first row: domain entry */
label = gtk_label_new (_("Domain Name:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
dialog->details->domain_entry = gtk_entry_new ();
@@ -1096,11 +1058,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* second row: username entry */
label = gtk_label_new (_("User Name:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
dialog->details->user_entry = gtk_entry_new ();
@@ -1112,11 +1070,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
/* third row: password entry */
label = gtk_label_new (_("Password:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
dialog->details->password_entry = gtk_entry_new ();
diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c
index a0a71a27..aae03b5e 100644
--- a/src/caja-desktop-window.c
+++ b/src/caja-desktop-window.c
@@ -144,9 +144,8 @@ caja_desktop_window_new (CajaApplication *application,
/* Stop wrong desktop window size in GTK 3.20*/
/* We don't want to set a default size, which the parent does, since this */
/* will cause the desktop window to open at the wrong size in gtk 3.20 */
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_window_set_default_size (GTK_WINDOW (window), -1, -1);
-#endif
+
/* Special sawmill setting*/
gtk_window_set_wmclass (GTK_WINDOW (window), "desktop_window", "Caja");
@@ -250,7 +249,6 @@ realize (GtkWidget *widget)
G_CALLBACK (caja_desktop_window_screen_size_changed), window);
}
-#if GTK_CHECK_VERSION (3, 22, 0)
static gboolean
draw (GtkWidget *widget,
cairo_t *cr)
@@ -259,7 +257,6 @@ draw (GtkWidget *widget,
return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr);
}
-#endif
static char *
real_get_title (CajaWindow *window)
@@ -283,9 +280,8 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass)
wclass->realize = realize;
wclass->unrealize = unrealize;
wclass->map = map;
-#if GTK_CHECK_VERSION (3, 22, 0)
wclass->draw = draw;
-#endif
+
nclass->window_type = CAJA_WINDOW_DESKTOP;
nclass->get_title = real_get_title;
nclass->get_icon = real_get_icon;
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index 670483e6..7800c7a4 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -222,15 +222,9 @@ preferences_show_help (GtkWindow *parent,
help_string = g_strdup_printf ("help:%s/%s", helpfile, sect_id);
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (parent,
help_string, gtk_get_current_event_time (),
&error);
-#else
- gtk_show_uri (gtk_window_get_screen (parent),
- help_string, gtk_get_current_event_time (),
- &error);
-#endif
g_free (help_string);
if (error)
diff --git a/src/caja-history-sidebar.c b/src/caja-history-sidebar.c
index c7a5b9ff..de4e71dc 100644
--- a/src/caja-history-sidebar.c
+++ b/src/caja-history-sidebar.c
@@ -275,9 +275,8 @@ caja_history_sidebar_init (CajaHistorySidebar *sidebar)
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sidebar), GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (sidebar), FALSE);
-#endif
+
gtk_container_add (GTK_CONTAINER (sidebar), GTK_WIDGET (tree_view));
gtk_widget_show (GTK_WIDGET (sidebar));
diff --git a/src/caja-image-properties-page.c b/src/caja-image-properties-page.c
index 12c79e38..465145df 100644
--- a/src/caja-image-properties-page.c
+++ b/src/caja-image-properties-page.c
@@ -141,12 +141,8 @@ append_label (GtkWidget *vbox,
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), str);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_label_set_yalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
/* setting can_focus to FALSE will allow to make the label
diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c
index 17bdd989..ad9c423e 100644
--- a/src/caja-location-bar.c
+++ b/src/caja-location-bar.c
@@ -492,12 +492,8 @@ caja_location_bar_init (CajaLocationBar *bar)
label = gtk_label_new (LOCATION_LABEL);
gtk_container_add (GTK_CONTAINER (event_box), label);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 1.0);
gtk_label_set_yalign (GTK_LABEL (label), 0.5);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-#endif
g_signal_connect (label, "style_set",
G_CALLBACK (style_set_handler), NULL);
diff --git a/src/caja-location-dialog.c b/src/caja-location-dialog.c
index 43503b1b..1e9a0b38 100644
--- a/src/caja-location-dialog.c
+++ b/src/caja-location-dialog.c
@@ -94,15 +94,9 @@ response_callback (CajaLocationDialog *dialog,
break;
case GTK_RESPONSE_HELP :
error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-user-guide/caja-open-location",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "help:mate-user-guide/caja-open-location",
- gtk_get_current_event_time (), &error);
-#endif
if (error)
{
eel_show_error_dialog (_("There was an error displaying help."), error->message,
diff --git a/src/caja-main.c b/src/caja-main.c
index ea299302..c74e43b0 100644
--- a/src/caja-main.c
+++ b/src/caja-main.c
@@ -250,11 +250,6 @@ main (int argc, char *argv[])
mallopt (M_MMAP_THRESHOLD, 128 *1024);
#endif
-#if !GLIB_CHECK_VERSION (2, 42, 0)
- /* This will be done by gtk+ later, but for now, force it to MATE */
- g_desktop_app_info_set_desktop_env ("MATE");
-#endif
-
if (g_getenv ("CAJA_DEBUG") != NULL) {
eel_make_warnings_and_criticals_stop_in_debugger ();
}
diff --git a/src/caja-notebook.c b/src/caja-notebook.c
index a860df2b..751e6161 100644
--- a/src/caja-notebook.c
+++ b/src/caja-notebook.c
@@ -306,12 +306,9 @@ build_tab_label (CajaNotebook *nb, CajaWindowSlot *slot)
label = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_label_set_yalign (GTK_LABEL (label), 0.5);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
+
gtk_widget_set_margin_start (label, 0);
gtk_widget_set_margin_end (label, 0);
gtk_widget_set_margin_top (label, 0);
@@ -325,11 +322,7 @@ build_tab_label (CajaNotebook *nb, CajaWindowSlot *slot)
gtk_button_set_relief (GTK_BUTTON (close_button),
GTK_RELIEF_NONE);
/* don't allow focus on the close button */
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (close_button, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (close_button), FALSE);
-#endif
gtk_widget_set_name (close_button, "caja-tab-close-button");
diff --git a/src/caja-notes-viewer.c b/src/caja-notes-viewer.c
index a825c316..b479cc56 100644
--- a/src/caja-notes-viewer.c
+++ b/src/caja-notes-viewer.c
@@ -347,9 +347,8 @@ caja_notes_viewer_init (CajaNotesViewer *sidebar)
GTK_SHADOW_IN);
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (sidebar), FALSE);
-#endif
+
gtk_container_add (GTK_CONTAINER (sidebar), details->note_text_field);
g_signal_connect (details->note_text_field, "focus_out_event",
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index d9b776ad..863e0623 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -150,11 +150,7 @@ get_slider_button (CajaPathBar *path_bar,
GtkWidget *button;
button = gtk_button_new ();
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (button, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
-#endif
gtk_widget_add_events (button, GDK_SCROLL_MASK);
gtk_container_add (GTK_CONTAINER (button),
gtk_image_new_from_icon_name (arrow_type, GTK_ICON_SIZE_MENU));
@@ -1841,11 +1837,7 @@ make_directory_button (CajaPathBar *path_bar,
button_data->button = gtk_toggle_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (button_data->button),
"text-button");
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (button_data->button, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE);
-#endif
gtk_widget_add_events (button_data->button, GDK_SCROLL_MASK);
/* TODO update button type when xdg directories change */
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c
index ba2e6c0e..9d081f6d 100644
--- a/src/caja-places-sidebar.c
+++ b/src/caja-places-sidebar.c
@@ -3142,9 +3142,8 @@ caja_places_sidebar_init (CajaPlacesSidebar *sidebar)
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sidebar), GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling(GTK_SCROLLED_WINDOW (sidebar), FALSE);
-#endif
+
/* tree view */
tree_view = GTK_TREE_VIEW (gtk_tree_view_new ());
gtk_tree_view_set_headers_visible (tree_view, FALSE);
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index a7e517c4..09233e9c 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -326,10 +326,8 @@ caja_property_browser_init (CajaPropertyBrowser *property_browser)
gtk_widget_show (property_browser->details->category_container);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (property_browser->details->category_container),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (property_browser->details->category_container),
FALSE);
-#endif
/* allocate a table to hold the category selector */
property_browser->details->category_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
@@ -1124,11 +1122,7 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser)
/* make the keyword label and field */
widget = gtk_label_new_with_mnemonic(_("_Keyword:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (widget), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
-#endif
gtk_widget_show(widget);
gtk_grid_attach(GTK_GRID(grid), widget, 0, 0, 1, 1);
@@ -1147,11 +1141,7 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser)
/* set up a file chooser to pick the image file */
label = gtk_label_new_with_mnemonic (_("_Image:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-#endif
gtk_widget_show (label);
gtk_grid_attach (GTK_GRID(grid), label, 0, 1, 1, 1);
@@ -1658,15 +1648,9 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_browser)
GError *error = NULL;
GtkWidget *dialog;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (property_browser),
"help:mate-user-guide/goscaja-50",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_widget_get_screen (property_browser),
- "help:mate-user-guide/goscaja-50",
- gtk_get_current_event_time (), &error);
-#endif
if (error)
{
@@ -2208,10 +2192,8 @@ caja_property_browser_update_contents (CajaPropertyBrowser *property_browser)
gtk_widget_show (property_browser->details->content_frame);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (property_browser->details->content_frame),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (property_browser->details->content_frame),
FALSE);
-#endif
/* allocate a table to hold the content widgets */
property_browser->details->content_table = eel_image_table_new (TRUE);
diff --git a/src/caja-query-editor.c b/src/caja-query-editor.c
index d9ae2284..f151eccd 100644
--- a/src/caja-query-editor.c
+++ b/src/caja-query-editor.c
@@ -723,10 +723,8 @@ type_combo_changed (GtkComboBox *combo_box, CajaQueryEditorRow *row)
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled),
FALSE);
-#endif
gtk_widget_show (scrolled);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scrolled, TRUE, TRUE, 6);
diff --git a/src/caja-view-as-action.c b/src/caja-view-as-action.c
index ab91f4dd..7baed932 100644
--- a/src/caja-view-as-action.c
+++ b/src/caja-view-as-action.c
@@ -180,11 +180,7 @@ connect_proxy (GtkAction *action,
view_as_combo_box = gtk_combo_box_text_new ();
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (view_as_combo_box, FALSE);
-#else
- gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (view_as_combo_box), FALSE);
-#endif
gtk_box_pack_end (GTK_BOX (view_as_menu_vbox), view_as_combo_box, TRUE, FALSE, 0);
gtk_widget_show (view_as_combo_box);
g_signal_connect_object (view_as_combo_box, "changed",
diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c
index 6e46fd5a..8eefea3e 100644
--- a/src/caja-window-menus.c
+++ b/src/caja-window-menus.c
@@ -575,19 +575,11 @@ action_caja_manual_callback (GtkAction *action,
error = NULL;
window = CAJA_WINDOW (user_data);
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (window),
CAJA_IS_DESKTOP_WINDOW (window)
? "help:mate-user-guide"
: "help:mate-user-guide/goscaja-1",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)),
- CAJA_IS_DESKTOP_WINDOW (window)
- ? "help:mate-user-guide"
- : "help:mate-user-guide/goscaja-1",
- gtk_get_current_event_time (), &error);
-#endif
if (error)
{
diff --git a/src/caja-window.c b/src/caja-window.c
index 10e71b35..ac22b6d8 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -133,20 +133,11 @@ caja_window_init (CajaWindow *window)
GtkWidget *menu;
GtkWidget *statusbar;
-#if GTK_CHECK_VERSION (3, 20, 0)
static const gchar css_custom[] =
"#caja-extra-view-widget {"
" background-color: " EXTRA_VIEW_WIDGETS_BACKGROUND ";"
"}";
-#else
- static const gchar css_custom[] =
- "#statusbar-no-border {"
- " -GtkStatusbar-shadow-type: none;"
- "}"
- "#caja-extra-view-widget {"
- " background-color: " EXTRA_VIEW_WIDGETS_BACKGROUND ";"
- "}";
-#endif
+
GError *error = NULL;
GtkCssProvider *provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, css_custom, -1, &error);
diff --git a/src/caja-x-content-bar.c b/src/caja-x-content-bar.c
index 8c834215..0e2c916d 100644
--- a/src/caja-x-content-bar.c
+++ b/src/caja-x-content-bar.c
@@ -307,11 +307,7 @@ caja_x_content_bar_init (CajaXContentBar *bar)
gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_HORIZONTAL);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (bar->priv->label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (bar), bar->priv->label, TRUE, TRUE, 0);
bar->priv->button = gtk_button_new ();
diff --git a/src/caja-zoom-control.c b/src/caja-zoom-control.c
index 8f8ffdd6..c21e06e4 100644
--- a/src/caja-zoom-control.c
+++ b/src/caja-zoom-control.c
@@ -144,13 +144,8 @@ menu_position_under_widget (GtkMenu *menu,
GtkRequisition req;
GtkRequisition menu_req;
GdkRectangle monitor;
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor_num;
GdkDisplay *display;
-#else
- int monitor_num;
- GdkScreen *screen;
-#endif
GtkAllocation allocation;
widget = GTK_WIDGET (user_data);
@@ -163,21 +158,11 @@ menu_position_under_widget (GtkMenu *menu,
gtk_widget_get_preferred_size (widget, &req, NULL);
gtk_widget_get_allocation (widget, &allocation);
-#if GTK_CHECK_VERSION (3, 22, 0)
display = gtk_widget_get_display (GTK_WIDGET (menu));
monitor_num = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget));
if (monitor_num == NULL)
monitor_num = gdk_display_get_monitor (display, 0);
gdk_monitor_get_geometry (monitor_num, &monitor);
-#else
- screen = gtk_widget_get_screen (GTK_WIDGET (menu));
- monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
- if (monitor_num < 0)
- {
- monitor_num = 0;
- }
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
-#endif
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
if (!gtk_widget_get_has_window (widget))
@@ -324,11 +309,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control)
image = gtk_image_new_from_icon_name ("zoom-out", GTK_ICON_SIZE_MENU);
zoom_control->details->zoom_out = gtk_button_new ();
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (zoom_control->details->zoom_out, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_out), FALSE);
-#endif
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_out),
GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text (zoom_control->details->zoom_out,
@@ -344,11 +325,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control)
zoom_control->details->zoom_out, FALSE, FALSE, 0);
zoom_control->details->zoom_button = gtk_button_new ();
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (zoom_control->details->zoom_button, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_button), FALSE);
-#endif
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_button),
GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text (zoom_control->details->zoom_button,
@@ -387,11 +364,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control)
image = gtk_image_new_from_icon_name ("zoom-in", GTK_ICON_SIZE_MENU);
zoom_control->details->zoom_in = gtk_button_new ();
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_set_focus_on_click (zoom_control->details->zoom_in, FALSE);
-#else
- gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_in), FALSE);
-#endif
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_in),
GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text (zoom_control->details->zoom_in,
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 26b2751f..a790d3f8 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -316,7 +316,6 @@ fm_desktop_icon_view_handle_middle_click (CajaIconContainer *icon_container,
FMDesktopIconView *desktop_icon_view)
{
XButtonEvent x_event;
-#if GTK_CHECK_VERSION (3, 20, 0)
GdkDevice *keyboard = NULL, *pointer = NULL, *cur;
GdkSeat *seat;
@@ -346,45 +345,6 @@ fm_desktop_icon_view_handle_middle_click (CajaIconContainer *icon_container,
if (keyboard != NULL) {
gdk_seat_ungrab (seat);
}
-#else
- GdkDevice *keyboard = NULL, *pointer = NULL, *cur;
- GdkDeviceManager *manager;
- GList *list, *l;
-
- manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (icon_container)));
- list = gdk_device_manager_list_devices (manager, GDK_DEVICE_TYPE_MASTER);
-
- for (l = list; l != NULL; l = l->next) {
- cur = l->data;
-
- if (pointer == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_MOUSE)) {
- pointer = cur;
- }
-
- if (keyboard == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_KEYBOARD)) {
- keyboard = cur;
- }
-
- if (pointer != NULL && keyboard != NULL) {
- break;
- }
- }
-
- g_list_free (list);
-
- /* During a mouse click we have the pointer and keyboard grab.
- * We will send a fake event to the root window which will cause it
- * to try to get the grab so we need to let go ourselves.
- */
-
- if (pointer != NULL) {
- gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
- }
-
- if (keyboard != NULL) {
- gdk_device_ungrab (keyboard, GDK_CURRENT_TIME);
- }
-#endif
/* Stop the event because we don't want anyone else dealing with it. */
gdk_flush ();
@@ -637,9 +597,7 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (desktop_icon_view),
GTK_SHADOW_NONE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (desktop_icon_view), FALSE);
-#endif
fm_directory_view_ignore_hidden_file_preferences
(FM_DIRECTORY_VIEW (desktop_icon_view));
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 82d1f234..75e42397 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -1170,15 +1170,9 @@ pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data)
break;
case GTK_RESPONSE_HELP :
error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-user-guide/caja-select-pattern",
gtk_get_current_event_time (), &error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "help:mate-user-guide/caja-select-pattern",
- gtk_get_current_event_time (), &error);
-#endif
if (error) {
eel_show_error_dialog (_("There was an error displaying help."), error->message,
GTK_WINDOW (dialog));
@@ -1362,11 +1356,7 @@ action_save_search_as_callback (GtkAction *action,
gtk_widget_show (grid);
label = gtk_label_new_with_mnemonic (_("Search _name:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
gtk_widget_show (label);
entry = gtk_entry_new ();
@@ -1382,11 +1372,7 @@ action_save_search_as_callback (GtkAction *action,
gtk_widget_show (entry);
label = gtk_label_new_with_mnemonic (_("_Folder:"));
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.5);
-#endif
gtk_container_add (GTK_CONTAINER (grid), label);
gtk_widget_show (label);
@@ -2006,9 +1992,7 @@ fm_directory_view_init (FMDirectoryView *view)
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_ETCHED_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (view), FALSE);
-#endif
set_up_scripts_directory_global ();
scripts_directory = caja_directory_get_by_uri (scripts_directory_uri);
diff --git a/src/file-manager/fm-ditem-page.c b/src/file-manager/fm-ditem-page.c
index 08f87b20..cdcf4fd0 100644
--- a/src/file-manager/fm-ditem-page.c
+++ b/src/file-manager/fm-ditem-page.c
@@ -341,11 +341,7 @@ build_grid (GtkWidget *container,
label = gtk_label_new (label_text);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (label_text);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_size_group_add_widget (label_size_group, label);
entry = gtk_entry_new ();
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index 4b416187..aadb3463 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -3318,9 +3318,9 @@ fm_icon_view_create (CajaWindowSlotInfo *slot)
"window-slot", slot,
"compact", FALSE,
NULL);
-#if GTK_CHECK_VERSION (3, 20, 0)
+
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (view)), GTK_STYLE_CLASS_VIEW);
-#endif
+
return CAJA_VIEW (view);
}
@@ -3333,9 +3333,9 @@ fm_compact_view_create (CajaWindowSlotInfo *slot)
"window-slot", slot,
"compact", TRUE,
NULL);
-#if GTK_CHECK_VERSION (3, 20, 0)
+
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (view)), GTK_STYLE_CLASS_VIEW);
-#endif
+
return CAJA_VIEW (view);
}
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 12fa8e5b..32d965a1 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -2552,12 +2552,8 @@ create_column_editor (FMListView *view)
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_label_set_line_wrap (GTK_LABEL (label), FALSE);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_label_set_yalign (GTK_LABEL (label), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
-#endif
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 1ae66b62..7bfa219b 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -1372,11 +1372,7 @@ attach_label (GtkGrid *grid,
gtk_label_set_selectable (GTK_LABEL (label_field), TRUE);
}
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label_field), 0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label_field), 0, 0.5);
-#endif
gtk_widget_show (label_field);
if (ellipsize_text) {
gtk_widget_set_hexpand (label_field, TRUE);
@@ -3421,10 +3417,10 @@ create_emblems_page (FMPropertiesWindow *window)
scroller = eel_scrolled_wrap_table_new (TRUE, GTK_SHADOW_NONE, &emblems_table);
gtk_container_set_border_width (GTK_CONTAINER (emblems_table), 12);
-/*stop GTK 3.22 builds from ballooning the properties dialog to full screen height */
-#if GTK_CHECK_VERSION (3, 22, 0)
+
+ /* stop GTK 3.22 builds from ballooning the properties dialog to full screen height */
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), 300);
-#endif
+
gtk_widget_show (scroller);
gtk_notebook_append_page (window->details->notebook,
@@ -5405,17 +5401,10 @@ real_response (GtkDialog *dialog,
switch (response) {
case GTK_RESPONSE_HELP:
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-user-guide/goscaja-51",
gtk_get_current_event_time (),
&error);
-#else
- gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
- "help:mate-user-guide/goscaja-51",
- gtk_get_current_event_time (),
- &error);
-#endif
if (error != NULL) {
eel_show_error_dialog (_("There was an error displaying help."), error->message,
GTK_WINDOW (dialog));
diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c
index ea42c420..643ae185 100644
--- a/src/file-manager/fm-tree-view.c
+++ b/src/file-manager/fm-tree-view.c
@@ -1591,9 +1591,7 @@ fm_tree_view_init (FMTreeView *view)
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (view), FALSE);
-#endif
gtk_widget_show (GTK_WIDGET (view));
diff --git a/test/test-eel-editable-label.c b/test/test-eel-editable-label.c
index 3120a4a9..2f878fa9 100644
--- a/test/test-eel-editable-label.c
+++ b/test/test-eel-editable-label.c
@@ -37,21 +37,13 @@ main (int argc, char* argv[])
label = eel_editable_label_new ("Left aligned label");
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);
label = eel_editable_label_new ("Right aligned label");
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 1.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 4);