diff options
author | monsta <[email protected]> | 2018-01-29 17:28:30 +0300 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-01-31 11:47:27 +0100 |
commit | 26a21fa2cb70a13b7e96ae43d4de825ad7663dc9 (patch) | |
tree | d61f2df112ee55e68de510d5c95b2531ba1fa922 /libcaja-private | |
parent | 0045e373ee71efb8ae9979adc4ef88d5dc90b2ea (diff) | |
download | caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.bz2 caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.xz |
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-autorun.c | 8 | ||||
-rw-r--r-- | libcaja-private/caja-column-chooser.c | 3 | ||||
-rw-r--r-- | libcaja-private/caja-dnd.c | 12 | ||||
-rw-r--r-- | libcaja-private/caja-file-conflict-dialog.c | 8 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 69 | ||||
-rw-r--r-- | libcaja-private/caja-mime-application-chooser.c | 6 | ||||
-rw-r--r-- | libcaja-private/caja-open-with-dialog.c | 11 | ||||
-rw-r--r-- | libcaja-private/caja-progress-info.c | 8 | ||||
-rw-r--r-- | libcaja-private/caja-tree-view-drag-dest.c | 14 |
9 files changed, 4 insertions, 135 deletions
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); |