diff options
author | Alexei Sorokin <[email protected]> | 2017-02-25 20:10:44 +0300 |
---|---|---|
committer | Alexei Sorokin <[email protected]> | 2017-02-25 20:10:44 +0300 |
commit | f8e542223bdd305ac69ed0380b05b9a0c99ad3ab (patch) | |
tree | 10b28c33da9893e8131731b99763a72aaeb134ca | |
parent | d8ac8e9c2b7781931e42b72e3200e269a0f27acb (diff) | |
download | caja-f8e542223bdd305ac69ed0380b05b9a0c99ad3ab.tar.bz2 caja-f8e542223bdd305ac69ed0380b05b9a0c99ad3ab.tar.xz |
Revert "GTK3.21:fix desktop redraw"
-rw-r--r-- | libcaja-private/caja-icon-container.c | 7 | ||||
-rw-r--r-- | src/caja-desktop-window.c | 141 | ||||
-rw-r--r-- | src/file-manager/fm-desktop-icon-view.c | 2 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 23 | ||||
-rw-r--r-- | src/file-manager/fm-icon-view.c | 10 | ||||
-rw-r--r-- | src/file-manager/fm-list-view.c | 6 |
6 files changed, 6 insertions, 183 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index b67ba5a6..385d88c2 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4707,8 +4707,6 @@ realize (GtkWidget *widget) GTK_WIDGET_CLASS (caja_icon_container_parent_class)->realize (widget); container = CAJA_ICON_CONTAINER (widget); - /* Unless GTK 3.21 or later is in use and the desktop must be transparent*/ -#if !GTK_CHECK_VERSION(3, 21, 0) /* Ensure that the desktop window is native so the background set on it is drawn by X. */ if (container->details->is_desktop) @@ -4719,7 +4717,6 @@ realize (GtkWidget *widget) gdk_x11_drawable_get_xid (gtk_layout_get_bin_window (GTK_LAYOUT (widget))); #endif } -#endif /* Set up DnD. */ caja_icon_dnd_init (container); @@ -6285,7 +6282,6 @@ popup_menu (GtkWidget *widget) return TRUE; } -#if !GTK_CHECK_VERSION(3, 21, 0) static void draw_canvas_background (EelCanvas *canvas, #if GTK_CHECK_VERSION(3,0,0) @@ -6296,7 +6292,6 @@ draw_canvas_background (EelCanvas *canvas, { /* Don't chain up to the parent to avoid clearing and redrawing */ } -#endif #if !GTK_CHECK_VERSION(3,0,0) @@ -6787,9 +6782,7 @@ caja_icon_container_class_init (CajaIconContainerClass *class) widget_class->grab_notify = grab_notify_cb; canvas_class = EEL_CANVAS_CLASS (class); -#if !GTK_CHECK_VERSION(3, 21, 0) canvas_class->draw_background = draw_canvas_background; -#endif class->start_interactive_search = caja_icon_container_start_interactive_search; #if GTK_CHECK_VERSION(3,0,0) diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index 1cc14348..f843d718 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -35,128 +35,17 @@ #include <libcaja-private/caja-icon-names.h> #include <gio/gio.h> #include <glib/gi18n.h> -#if GTK_CHECK_VERSION(3, 21, 0) -#define MATE_DESKTOP_USE_UNSTABLE_API -#include <libmate-desktop/mate-bg.h> -#endif struct CajaDesktopWindowDetails { gulong size_changed_id; gboolean loaded; -#if GTK_CHECK_VERSION(3, 21, 0) - gboolean composited; - cairo_surface_t *surface; -#endif }; G_DEFINE_TYPE (CajaDesktopWindow, caja_desktop_window, CAJA_TYPE_SPATIAL_WINDOW); -#if GTK_CHECK_VERSION(3, 21, 0) - -static void -background_changed (CajaDesktopWindow *window) -{ - GdkScreen *screen = gdk_screen_get_default (); - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - } - - window->details->surface = mate_bg_get_surface_from_root (screen); - gtk_widget_queue_draw (GTK_WIDGET (window)); -} - -static GdkFilterReturn -filter_func (GdkXEvent *xevent, - GdkEvent *event, - CajaDesktopWindow *window) -{ - XEvent *xev = (XEvent *) xevent; - GdkAtom gdkatom; - - if (xev->type != PropertyNotify) { - return GDK_FILTER_CONTINUE; - } - - gdkatom = gdk_atom_intern_static_string ("_XROOTPMAP_ID"); - if (xev->xproperty.atom != gdk_x11_atom_to_xatom (gdkatom)) { - return GDK_FILTER_CONTINUE; - } - - background_changed (window); - - return GDK_FILTER_CONTINUE; -} - -static void -caja_desktop_window_composited_changed (GtkWidget *widget) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (widget); - GdkScreen *screen = gdk_screen_get_default (); - gboolean composited = gdk_screen_is_composited (screen); - GdkWindow *root; - - if (window->details->composited == composited) { - return; - } - - window->details->composited = composited; - root = gdk_screen_get_root_window (screen); - - if (composited) { - gdk_window_remove_filter (root, (GdkFilterFunc) filter_func, window); - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - window->details->surface = NULL; - } - } else { - gint events = gdk_window_get_events (root); - - gdk_window_set_events (root, events | GDK_PROPERTY_CHANGE_MASK); - gdk_window_add_filter (root, (GdkFilterFunc) filter_func, window); - background_changed (window); - } -} - -static gboolean -caja_desktop_window_draw (GtkWidget *widget, - cairo_t *cr) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (widget); - - if (window->details->surface) { - cairo_set_source_surface (cr, window->details->surface, 0, 0); - cairo_paint (cr); - } - - return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr); -} - -static void -caja_desktop_window_finalize (GObject *obj) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (obj); - - if (window->details->composited == FALSE) { - GdkScreen *screen = gdk_screen_get_default (); - GdkWindow *root = gdk_screen_get_root_window (screen); - - gdk_window_remove_filter (root, (GdkFilterFunc) filter_func, window); - } - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - window->details->surface = NULL; - } - - G_OBJECT_CLASS (caja_desktop_window_parent_class)->finalize (obj); -} -#endif - static void caja_desktop_window_init (CajaDesktopWindow *window) { @@ -173,11 +62,6 @@ caja_desktop_window_init (CajaDesktopWindow *window) gtk_style_context_add_class (context, "caja-desktop-window"); #endif -#if GTK_CHECK_VERSION(3, 21, 0) - window->details->composited = TRUE; - caja_desktop_window_composited_changed (GTK_WIDGET (window)); -#endif - gtk_window_move (GTK_WINDOW (window), 0, 0); /* shouldn't really be needed given our semantic type @@ -283,13 +167,6 @@ map (GtkWidget *widget) /* Chain up to realize our children */ GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->map (widget); gdk_window_lower (gtk_widget_get_window (widget)); -#if GTK_CHECK_VERSION(3, 21, 0) - GdkWindow *window; - GdkRGBA transparent = { 0, 0, 0, 0 }; - - window = gtk_widget_get_window (widget); - gdk_window_set_background_rgba (window, &transparent); -#endif } static void @@ -359,21 +236,12 @@ realize (GtkWidget *widget) { CajaDesktopWindow *window; CajaDesktopWindowDetails *details; -#if GTK_CHECK_VERSION(3, 21, 0) - GdkVisual *visual; -#endif window = CAJA_DESKTOP_WINDOW (widget); details = window->details; /* Make sure we get keyboard events */ gtk_widget_set_events (widget, gtk_widget_get_events (widget) | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); -#if GTK_CHECK_VERSION(3, 21, 0) - visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)); - if (visual) { - gtk_widget_set_visual (widget, visual); - } -#endif /* Do the work of realizing. */ GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->realize (widget); @@ -405,19 +273,10 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass) { GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass); CajaWindowClass *nclass = CAJA_WINDOW_CLASS (klass); -#if GTK_CHECK_VERSION(3, 21, 0) - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = caja_desktop_window_finalize; -#endif wclass->realize = realize; wclass->unrealize = unrealize; wclass->map = map; -#if GTK_CHECK_VERSION(3, 21, 0) - wclass->composited_changed = caja_desktop_window_composited_changed; - wclass->draw = caja_desktop_window_draw; -#endif nclass->window_type = CAJA_WINDOW_DESKTOP; nclass->get_title = real_get_title; nclass->get_icon = real_get_icon; diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 1637532c..6e4952fa 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -38,9 +38,7 @@ #include <gdk/gdkx.h> #include <glib/gi18n.h> #include <libcaja-private/caja-desktop-icon-file.h> -#if !GTK_CHECK_VERSION(3, 21, 0) #include <libcaja-private/caja-directory-background.h> -#endif #include <libcaja-private/caja-directory-notify.h> #include <libcaja-private/caja-file-changes-queue.h> #include <libcaja-private/caja-file-operations.h> diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index b9d6f76f..1d9683b8 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -61,9 +61,7 @@ #include <libcaja-private/caja-desktop-directory.h> #include <libcaja-private/caja-extensions.h> #include <libcaja-private/caja-search-directory.h> -#if !GTK_CHECK_VERSION(3, 21, 0) #include <libcaja-private/caja-directory-background.h> -#endif #include <libcaja-private/caja-directory.h> #include <libcaja-private/caja-dnd.h> #include <libcaja-private/caja-file-attributes.h> @@ -423,9 +421,7 @@ EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, can_zoom_in) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, can_zoom_out) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, clear) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, file_changed) -#if !GTK_CHECK_VERSION(3, 21, 0) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_background_widget) -#endif EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_selection) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_selection_for_file_transfer) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_item_count) @@ -3692,7 +3688,6 @@ fm_directory_view_can_zoom_out (FMDirectoryView *view) can_zoom_out, (view)); } -#if !GTK_CHECK_VERSION(3, 21, 0) GtkWidget * fm_directory_view_get_background_widget (FMDirectoryView *view) { @@ -3718,7 +3713,7 @@ real_set_is_active (FMDirectoryView *view, bg = fm_directory_view_get_background (view); eel_background_set_active (bg, is_active); } -#endif + static void fm_directory_view_set_is_active (FMDirectoryView *view, gboolean is_active) @@ -7745,11 +7740,9 @@ real_merge_menus (FMDirectoryView *view) ui = caja_ui_string_get ("caja-directory-view-ui.xml"); view->details->dir_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, NULL); -#if !GTK_CHECK_VERSION(3, 21, 0) g_signal_connect_object (fm_directory_view_get_background (view), "settings_changed", G_CALLBACK (schedule_update_menus), G_OBJECT (view), G_CONNECT_SWAPPED); -#endif view->details->scripts_invalid = TRUE; view->details->templates_invalid = TRUE; } @@ -11105,12 +11098,10 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass) klass->supports_properties = real_supports_properties; klass->supports_zooming = real_supports_zooming; klass->using_manual_layout = real_using_manual_layout; - klass->merge_menus = real_merge_menus; - klass->unmerge_menus = real_unmerge_menus; - klass->update_menus = real_update_menus; -#if !GTK_CHECK_VERSION(3, 21, 0) - klass->set_is_active = real_set_is_active; -#endif + klass->merge_menus = real_merge_menus; + klass->unmerge_menus = real_unmerge_menus; + klass->update_menus = real_update_menus; + klass->set_is_active = real_set_is_active; /* Function pointers that subclasses must override */ EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, add_file); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, bump_zoom_level); @@ -11118,9 +11109,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass) EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, can_zoom_out); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, clear); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, file_changed); -#if !GTK_CHECK_VERSION(3, 21, 0) - EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_background_widget); -#endif + EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_background_widget); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_selection); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_selection_for_file_transfer); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_item_count); diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index ec167810..9c187466 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -30,9 +30,7 @@ #include "fm-desktop-icon-view.h" #include "fm-error-reporting.h" #include <stdlib.h> -#if !GTK_CHECK_VERSION(3, 21, 0) #include <eel/eel-background.h> -#endif #include <eel/eel-glib-extensions.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-gtk-macros.h> @@ -45,9 +43,7 @@ #include <glib/gi18n.h> #include <gio/gio.h> #include <libcaja-private/caja-clipboard-monitor.h> -#if !GTK_CHECK_VERSION(3, 21, 0) #include <libcaja-private/caja-directory-background.h> -#endif #include <libcaja-private/caja-directory.h> #include <libcaja-private/caja-dnd.h> #include <libcaja-private/caja-file-utilities.h> @@ -1281,7 +1277,6 @@ fm_icon_view_begin_loading (FMDirectoryView *view) /* kill any sound preview process that is ongoing */ preview_audio (icon_view, NULL, FALSE); -#if !GTK_CHECK_VERSION(3, 21, 0) /* FIXME bugzilla.gnome.org 45060: Should use methods instead * of hardcoding desktop knowledge in here. */ @@ -1305,7 +1300,6 @@ fm_icon_view_begin_loading (FMDirectoryView *view) caja_connect_background_to_file_metadata (icon_container, file, default_action); } -#endif /* Set up the zoom level from the metadata. */ if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) { @@ -1511,7 +1505,6 @@ fm_icon_view_can_zoom_out (FMDirectoryView *view) > CAJA_ZOOM_LEVEL_SMALLEST; } -#if !GTK_CHECK_VERSION(3, 21, 0) static GtkWidget * fm_icon_view_get_background_widget (FMDirectoryView *view) { @@ -1519,7 +1512,6 @@ fm_icon_view_get_background_widget (FMDirectoryView *view) return GTK_WIDGET (get_icon_container (FM_ICON_VIEW (view))); } -#endif static gboolean fm_icon_view_is_empty (FMDirectoryView *view) @@ -3199,9 +3191,7 @@ fm_icon_view_class_init (FMIconViewClass *klass) fm_directory_view_class->clear = fm_icon_view_clear; fm_directory_view_class->end_loading = fm_icon_view_end_loading; fm_directory_view_class->file_changed = fm_icon_view_file_changed; -#if !GTK_CHECK_VERSION(3, 21, 0) fm_directory_view_class->get_background_widget = fm_icon_view_get_background_widget; -#endif fm_directory_view_class->get_selected_icon_locations = fm_icon_view_get_selected_icon_locations; fm_directory_view_class->get_selection = fm_icon_view_get_selection; fm_directory_view_class->get_selection_for_file_transfer = fm_icon_view_get_selection; diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 163f1be8..4b155f27 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -47,9 +47,7 @@ #include <libcaja-private/caja-column-chooser.h> #include <libcaja-private/caja-column-utilities.h> #include <libcaja-private/caja-debug-log.h> -#if !GTK_CHECK_VERSION(3, 21, 0) #include <libcaja-private/caja-directory-background.h> -#endif #include <libcaja-private/caja-dnd.h> #include <libcaja-private/caja-file-dnd.h> #include <libcaja-private/caja-file-utilities.h> @@ -2121,13 +2119,11 @@ fm_list_view_file_changed (FMDirectoryView *view, CajaFile *file, CajaDirectory } } -#if !GTK_CHECK_VERSION(3, 21, 0) static GtkWidget * fm_list_view_get_background_widget (FMDirectoryView *view) { return GTK_WIDGET (view); } -#endif static void fm_list_view_get_selection_foreach_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) @@ -3329,9 +3325,7 @@ fm_list_view_class_init (FMListViewClass *class) fm_directory_view_class->click_policy_changed = fm_list_view_click_policy_changed; fm_directory_view_class->clear = fm_list_view_clear; fm_directory_view_class->file_changed = fm_list_view_file_changed; -#if !GTK_CHECK_VERSION(3, 21, 0) fm_directory_view_class->get_background_widget = fm_list_view_get_background_widget; -#endif fm_directory_view_class->get_selection = fm_list_view_get_selection; fm_directory_view_class->get_selection_for_file_transfer = fm_list_view_get_selection_for_file_transfer; fm_directory_view_class->get_item_count = fm_list_view_get_item_count; |