[Xfce4-commits] xfdesktop:master Minimize grid resizes
Updating branch refs/heads/master to dfb8f2141ca627e25d226ff259e7fe78cbd27434 (commit) from ad533417c2e491c36cfa0705aeb4cf020adad918 (commit) commit dfb8f2141ca627e25d226ff259e7fe78cbd27434 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Mar 2 12:46:40 2014 +0300 Minimize grid resizes Don't resize the grid on _NET_WORKAREA changes when the grid size doesn't actually change. src/xfdesktop-icon-view.c | 47 ++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 7d2c987..83edcf9 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -2701,13 +2701,18 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view) icon_view-priv-nrows = (height - SCREEN_MARGIN * 2) / CELL_SIZE; icon_view-priv-ncols = (width - SCREEN_MARGIN * 2) / CELL_SIZE; - -DBG(CELL_SIZE=%0.3f, TEXT_WIDTH=%0.3f, ICON_SIZE=%u, CELL_SIZE, TEXT_WIDTH, ICON_SIZE); -DBG(grid size is %dx%d, icon_view-priv-nrows, icon_view-priv-ncols); new_size = (guint)icon_view-priv-nrows * icon_view-priv-ncols * sizeof(XfdesktopIcon *); +if(old_size == new_size) { +DBG(old_size == new_size exiting); +return; +} + +DBG(CELL_SIZE=%0.3f, TEXT_WIDTH=%0.3f, ICON_SIZE=%u, CELL_SIZE, TEXT_WIDTH, ICON_SIZE); +DBG(grid size is %dx%d, icon_view-priv-nrows, icon_view-priv-ncols); + if(icon_view-priv-grid_layout) { icon_view-priv-grid_layout = g_realloc(icon_view-priv-grid_layout, new_size); @@ -3370,6 +3375,36 @@ xfdesktop_move_all_pending_icons_to_desktop(XfdesktopIconView *icon_view) static void xfdesktop_grid_do_resize(XfdesktopIconView *icon_view) { +gint xorigin = 0, yorigin = 0, width = 0, height = 0; +guint16 new_rows, new_cols; +gsize old_size, new_size; +GdkScreen *gscreen; + +/* First check to see if the grid actaully did change. This way + * we don't remove all the icons just to put them back again */ +old_size = (guint)icon_view-priv-nrows * icon_view-priv-ncols + * sizeof(XfdesktopIcon *); + +if(!xfdesktop_get_workarea_single(icon_view, 0, + xorigin, yorigin, + width, height)) +{ +gscreen = gtk_widget_get_screen(GTK_WIDGET(icon_view)); +width = gdk_screen_get_width(gscreen); +height = gdk_screen_get_height(gscreen); +} + +new_rows = (height - SCREEN_MARGIN * 2) / CELL_SIZE; +new_cols = (width - SCREEN_MARGIN * 2) / CELL_SIZE; + +new_size = (guint)new_rows * new_cols * sizeof(XfdesktopIcon *); + +if(old_size == new_size) { +DBG(old_size == new_size exiting); +return; +} + +/* Grid size did change */ xfdesktop_move_all_icons_to_pending_icons_list(icon_view); #if 0 /*def DEBUG*/ @@ -3530,9 +3565,15 @@ xfdesktop_grid_set_position_free(XfdesktopIconView *icon_view, g_return_if_fail(row icon_view-priv-nrows col icon_view-priv-ncols); +#if 0 /*def DEBUG*/ DUMP_GRID_LAYOUT(icon_view); +#endif + icon_view-priv-grid_layout[col * icon_view-priv-nrows + row] = NULL; + +#if 0 /*def DEBUG*/ DUMP_GRID_LAYOUT(icon_view); +#endif } static inline gboolean ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Remove old version check
Updating branch refs/heads/master to c0c498678def0f32f24bb0a1653408c78f9495da (commit) from e92af0cdace692250c289ea608568fc2b24d684d (commit) commit c0c498678def0f32f24bb0a1653408c78f9495da Author: Eric Koegel eric.koe...@gmail.com Date: Sun Mar 2 09:13:13 2014 +0300 Remove old version check src/xfce-desktop.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 5e1bb0a..7ba3caa 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1008,14 +1008,11 @@ xfce_desktop_realize(GtkWidget *widget) gtk_window_set_screen(GTK_WINDOW(desktop), desktop-priv-gscreen); sw = gdk_screen_get_width(desktop-priv-gscreen); sh = gdk_screen_get_height(desktop-priv-gscreen); -if(gtk_major_version 2 - || (gtk_major_version == 2 gtk_minor_version = 13)) -{ -g_signal_connect(G_OBJECT(desktop-priv-gscreen), - monitors-changed, - G_CALLBACK(xfce_desktop_monitors_changed), - desktop); -} + +g_signal_connect(G_OBJECT(desktop-priv-gscreen), + monitors-changed, + G_CALLBACK(xfce_desktop_monitors_changed), + desktop); /* chain up */ GTK_WIDGET_CLASS(xfce_desktop_parent_class)-realize(widget); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Right click edits launchers
Updating branch refs/heads/master to 12b9528fd10769fff10346a503922fa280d0c293 (commit) from c0c498678def0f32f24bb0a1653408c78f9495da (commit) commit 12b9528fd10769fff10346a503922fa280d0c293 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Mar 2 10:20:56 2014 +0300 Right click edits launchers When performing a right click, or shift + left click, on an item in the applications sub-menu of the desktop menu it will now pop up the dialog to edit the launcher. src/xfce-desktop.c|3 ++- src/xfdesktop-app-menu-item.c | 53 + 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 7ba3caa..85ea597 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1219,7 +1219,8 @@ xfce_desktop_popup_menu(GtkWidget *w) } xfce_desktop_popup_root_menu(XFCE_DESKTOP(w), button, etime); - + +gdk_event_free((GdkEvent*)evt); return TRUE; } diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c index ca19499..f443ec9 100644 --- a/src/xfdesktop-app-menu-item.c +++ b/src/xfdesktop-app-menu-item.c @@ -331,16 +331,67 @@ xfdesktop_app_menu_item_command(XfdesktopAppMenuItem *app_menu_item) return g_string_free(newstr, FALSE); } +static gboolean +xfdesktop_app_menu_item_edit_launcher(XfdesktopAppMenuItem *app_menu_item) +{ +GFile *file; +gchar *uri, *cmd; +GError *error = NULL; +gboolean ret = FALSE; + +file = garcon_menu_item_get_file(app_menu_item-item); + +if(file) { +uri = g_file_get_uri(file); +cmd = g_strdup_printf(exo-desktop-item-edit \%s\, uri); + +if(!xfce_spawn_command_line_on_screen(NULL, cmd, FALSE, FALSE, error)) { +xfce_message_dialog(NULL, _(Launch Error), +GTK_STOCK_DIALOG_ERROR, +_(Unable to launch \exo-desktop-item-edit\, which is required to create and edit launchers and links on the desktop.), +error-message, GTK_STOCK_CLOSE, +GTK_RESPONSE_ACCEPT, NULL); +g_error_free(error); +} else { +ret = TRUE; +} + +g_free(uri); +g_free(cmd); +g_object_unref(file); +} + +return ret; +} + static void xfdesktop_app_menu_item_activate (XfdesktopAppMenuItem *app_menu_item) { gchar *command; + GdkEventButton *evt; + guint button; GError *error = NULL; + TRACE(entering); + command = xfdesktop_app_menu_item_command(app_menu_item); if (command == NULL) return; + evt = (GdkEventButton *)gtk_get_current_event(); + + /* Right click edits the launchers */ + if(evt GDK_BUTTON_RELEASE == evt-type) { + button = evt-button; + + if(button == 3 || (button == 1 (evt-state GDK_SHIFT_MASK))) { +if(xfdesktop_app_menu_item_edit_launcher(app_menu_item)) { +gdk_event_free((GdkEvent*)evt); +return; +} + } + } + if(!xfce_spawn_command_line_on_screen(gtk_widget_get_screen(GTK_WIDGET(app_menu_item)), command, garcon_menu_item_requires_terminal(app_menu_item-item), @@ -350,6 +401,8 @@ xfdesktop_app_menu_item_activate (XfdesktopAppMenuItem *app_menu_item) command, error-message); g_error_free(error); } + +gdk_event_free((GdkEvent*)evt); } GtkWidget * ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix a crash when removing displays
Updating branch refs/heads/master to 22fd6840660e5154a7051647051deefea90bfe27 (commit) from 36387ed6c75662a42d822d32029e425ae73a556d (commit) commit 22fd6840660e5154a7051647051deefea90bfe27 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Feb 26 12:43:02 2014 +0300 Fix a crash when removing displays When a screen is extended to the right and then changed to mirrored this can cause xfdesktop to crash. This patch does a sanity check to ensure there is a backdrop when the backdrop_changed_cb is called. src/xfce-desktop.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 9be8504..53be20e 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -367,7 +367,10 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data) TRACE(entering); g_return_if_fail(XFCE_IS_DESKTOP(desktop)); - + +if(!XFCE_IS_BACKDROP(backdrop)) +return; + if(desktop-priv-updates_frozen || !gtk_widget_get_realized(GTK_WIDGET(desktop))) return; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix a runtime warning
Updating branch refs/heads/master to 19df3baad37c51d2ebc8cef0d3b0dfa8ab098033 (commit) from 22fd6840660e5154a7051647051deefea90bfe27 (commit) commit 19df3baad37c51d2ebc8cef0d3b0dfa8ab098033 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Feb 26 13:46:57 2014 +0300 Fix a runtime warning If one of the checks in the style refresh happened then the refresh timer was destroyed with a return FALSE, but our source id for that timer wasn't cleared. This fixes it. src/xfce-desktop.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 53be20e..5e1bb0a 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1268,7 +1268,9 @@ style_refresh_cb(gpointer *w) TRACE(entering); -g_return_if_fail(XFCE_IS_DESKTOP(desktop)); +desktop-priv-style_refresh_timer = 0; + +g_return_val_if_fail(XFCE_IS_DESKTOP(desktop), FALSE); if(!gtk_widget_get_realized(GTK_WIDGET(desktop))) return FALSE; @@ -1286,8 +1288,6 @@ style_refresh_cb(gpointer *w) xfce_desktop_setup_icon_view(desktop); #endif -desktop-priv-style_refresh_timer = 0; - return FALSE; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Better migration from previous version
Updating branch refs/heads/master to 26feb3b13e8c3c5ea9f41a51768dec230f139f15 (commit) from 68be2f077b28db13eb5c4c095fbdc9b9027e5143 (commit) commit 26feb3b13e8c3c5ea9f41a51768dec230f139f15 Author: Eric Koegel eric.koe...@gmail.com Date: Tue Feb 25 12:08:46 2014 +0300 Better migration from previous version This code makes xfdesktop set whatever settings it finds to xfconf. This way it isn't always trying to migrate if the user never defines anything. There was also a couple bugs in the migration code that have been fixed. Additionally, when gtk sends a style set we only recreate the icon view (to update the labels) rather than refrsh the wallpaper as well. This should make xfdesktop startup a little faster. The style set workaround will go away in GTK3 when we get there. src/xfce-backdrop.c |6 +- src/xfce-desktop.c | 45 +++ src/xfce-workspace.c | 214 -- 3 files changed, 190 insertions(+), 75 deletions(-) diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index f0139f2..6ee798b 100644 --- a/src/xfce-backdrop.c +++ b/src/xfce-backdrop.c @@ -1356,8 +1356,10 @@ xfce_backdrop_set_cache_pixbuf(XfceBackdrop *backdrop, TRACE(entering); -if(backdrop-priv-cache_pixbuf == cache_pixbuf) +if(backdrop-priv-cache_pixbuf == cache_pixbuf) { +DBG(No change, cache_pixbuf %s, cache_pixbuf ? TRUE : FALSE); return; +} backdrop-priv-cache_pixbuf = cache_pixbuf; @@ -1503,6 +1505,8 @@ xfce_backdrop_generate_async(XfceBackdrop *backdrop) else image_path = DEFAULT_BACKDROP; +DBG(loading image %s, image_path); + file = g_file_new_for_path(image_path); image_data = g_new0(XfceBackdropImageData, 1); diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index b076589..ec66110 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -604,7 +604,7 @@ workspace_changed_cb(WnckScreen *wnck_screen, { XfceDesktop *desktop = XFCE_DESKTOP(user_data); gint current_workspace, new_workspace, i; -XfceBackdrop *new_backdrop; +XfceBackdrop *current_backdrop, *new_backdrop; TRACE(entering); @@ -625,11 +625,16 @@ workspace_changed_cb(WnckScreen *wnck_screen, current_workspace, new_workspace); for(i = 0; i xfce_desktop_get_n_monitors(desktop); i++) { -/* Sanity check */ +/* We want to compare the current workspace backdrop with the new one + * and see if we can avoid changing them if they are the same image/style */ if(current_workspace desktop-priv-nworkspaces current_workspace = 0) { -/* update! */ +current_backdrop = xfce_workspace_get_backdrop(desktop-priv-workspaces[current_workspace], i); new_backdrop = xfce_workspace_get_backdrop(desktop-priv-workspaces[new_workspace], i); -backdrop_changed_cb(new_backdrop, user_data); + +if(!xfce_backdrop_compare_backdrops(current_backdrop, new_backdrop) || !desktop-priv-bg_pixmap) { +/* only update monitors that require it */ +backdrop_changed_cb(new_backdrop, user_data); +} } else { /* If current_workspace was removed or never existed, get the new * backdrop and apply it */ @@ -1258,7 +1263,26 @@ style_refresh_cb(gpointer *w) { XfceDesktop *desktop = XFCE_DESKTOP(w); -xfce_desktop_refresh(desktop); +TRACE(entering); + +g_return_if_fail(XFCE_IS_DESKTOP(desktop)); + +if(!gtk_widget_get_realized(GTK_WIDGET(desktop))) +return FALSE; + +if(desktop-priv-workspaces == NULL) { +return FALSE; +} + +#ifdef ENABLE_DESKTOP_ICONS +/* reload icon view */ +if(desktop-priv-icon_view) { +gtk_widget_destroy(desktop-priv-icon_view); +desktop-priv-icon_view = NULL; +} +xfce_desktop_setup_icon_view(desktop); +#endif + desktop-priv-style_refresh_timer = 0; return FALSE; @@ -1657,6 +1681,8 @@ xfce_desktop_refresh(XfceDesktop *desktop) { gint i, current_workspace; +TRACE(entering); + g_return_if_fail(XFCE_IS_DESKTOP(desktop)); if(!gtk_widget_get_realized(GTK_WIDGET(desktop))) @@ -1676,15 +1702,6 @@ xfce_desktop_refresh(XfceDesktop *desktop) backdrop_changed_cb(backdrop, desktop); } - -#ifdef ENABLE_DESKTOP_ICONS -/* reload icon view */ -if(desktop-priv-icon_view) { -gtk_widget_destroy(desktop-priv-icon_view); -desktop-priv-icon_view = NULL; -} -xfce_desktop_setup_icon_view(desktop); -#endif } void xfce_desktop_arrange_icons(XfceDesktop *desktop) diff --git a/src/xfce-workspace.c b/src/xfce-workspace.c index 13aa924..c5e5633 100644 --- a/src/xfce-workspace.c +++ b/src/xfce-workspace.c @@ -138,44 +138,98 @@ xfce_workspace_get_xinerama_stretch(XfceWorkspace *workspace) } static void -xfce_workspace_change_backdrop(XfceWorkspace
[Xfce4-commits] xfdesktop:master Reload the iconview on reload
Updating branch refs/heads/master to 36387ed6c75662a42d822d32029e425ae73a556d (commit) from 26feb3b13e8c3c5ea9f41a51768dec230f139f15 (commit) commit 36387ed6c75662a42d822d32029e425ae73a556d Author: Eric Koegel eric.koe...@gmail.com Date: Wed Feb 26 10:02:35 2014 +0300 Reload the iconview on reload Cut the icon view code rather than a copy. Putting it back in. src/xfce-desktop.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index ec66110..9be8504 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1702,6 +1702,16 @@ xfce_desktop_refresh(XfceDesktop *desktop) backdrop_changed_cb(backdrop, desktop); } + +#ifdef ENABLE_DESKTOP_ICONS +/* reload icon view */ +if(desktop-priv-icon_view) { +gtk_widget_destroy(desktop-priv-icon_view); +desktop-priv-icon_view = NULL; +} +xfce_desktop_setup_icon_view(desktop); +#endif + } void xfce_desktop_arrange_icons(XfceDesktop *desktop) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix a couple runtime warnings
Updating branch refs/heads/master to b1a7c62d4e78dc1cee7e3d499440618c085c7d48 (commit) from d309a6949b751002b33ed432f88fd47a1384db0e (commit) commit b1a7c62d4e78dc1cee7e3d499440618c085c7d48 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Feb 23 13:37:20 2014 +0300 Fix a couple runtime warnings settings/main.c |2 ++ src/xfdesktop-file-icon-manager.c |7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/settings/main.c b/settings/main.c index a34256e..7fe6da6 100644 --- a/settings/main.c +++ b/settings/main.c @@ -560,6 +560,8 @@ cb_destroy_add_dir_enumeration(gpointer user_data) g_object_unref(panel-cancel_enumeration); panel-cancel_enumeration = NULL; } + +panel-add_dir_idle_id = 0; } static gboolean diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 9e9ad3c..f5bc994 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2736,7 +2736,12 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator, * send notification messages when monitored files change */ if(!fmanager-priv-metadata_monitor) { gchar *location = xfce_resource_lookup(XFCE_RESOURCE_DATA, gvfs-metadata/); -GFile *metadata_location = g_file_new_for_path(location); +GFile *metadata_location; + +if(location == NULL) +return; + +metadata_location = g_file_new_for_path(location); fmanager-priv-metadata_monitor = g_file_monitor(metadata_location, G_FILE_MONITOR_NONE, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix an settings issue when plug names aren't available
Updating branch refs/heads/master to 05adaa59dbedd89b3e0ae6001ff367572c1be7d2 (commit) from b1a7c62d4e78dc1cee7e3d499440618c085c7d48 (commit) commit 05adaa59dbedd89b3e0ae6001ff367572c1be7d2 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Feb 23 14:49:49 2014 +0300 Fix an settings issue when plug names aren't available When gdk_screen_get_monitor_plug_name doesn't return a monitor name we were comparing monitor numbers but that check meant the first monitor never got its settings updated. settings/main.c |5 - 1 file changed, 5 deletions(-) diff --git a/settings/main.c b/settings/main.c index 7fe6da6..2661d40 100644 --- a/settings/main.c +++ b/settings/main.c @@ -1449,11 +1449,6 @@ cb_update_background_tab(WnckWindow *wnck_window, g_free(monitor_name); return; } -} else { -/* Check if we haven't changed monitors (by number) */ -if(panel-monitor == monitor_num) { -return; -} } } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Clean up some user strings
Updating branch refs/heads/master to d1d98fb12fd461bd00b99e821cae155ccd926716 (commit) from 755ae10f0b20bc4f105d9a35b2596bae956bc1ff (commit) commit d1d98fb12fd461bd00b99e821cae155ccd926716 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 24 10:16:20 2014 +0300 Clean up some user strings 1) Some tooltips end with a period, some do not. This has been unified. 2) You are using more than one display, move this dialog to the display you want to edit the settings for. This takes a lot of space and brings along a bit of redundancy. Changed to Move this dialog to the display you want to edit the settings for. 3) Other items on the third tab, below removable devices: devices is a better term than items. Changed. Thanks to Harald Judt for pointing these issues out. settings/main.c |8 +++- settings/xfdesktop-settings-appearance-frame-ui.glade | 12 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/settings/main.c b/settings/main.c index 2661d40..a79a112 100644 --- a/settings/main.c +++ b/settings/main.c @@ -384,7 +384,7 @@ setup_special_icon_list(GtkBuilder *gxml, DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, TRUE }, { N_(Disks and Drives), drive-harddisk-usb, gnome-dev-removable-usb, DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, TRUE }, -{ N_(Other Items), phone-symbolic, phone, +{ N_(Other Devices), phone-symbolic, phone, DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, TRUE }, { NULL, NULL, NULL, NULL, FALSE }, }; @@ -692,8 +692,7 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel, /* This is for the infobar letting the user know how to configure * multiple monitor setups */ gtk_label_set_text(GTK_LABEL(panel-infobar_label), - _(You are using more than one display, - move this dialog to the display you + _(Move this dialog to the display you want to edit the settings for.)); gtk_widget_set_visible(panel-infobar, TRUE); } else { @@ -711,8 +710,7 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel, /* This is for the infobar letting the user know how to configure * multiple monitor/workspace setups */ gtk_label_set_text(GTK_LABEL(panel-infobar_label), - _(You are using more than one display, - move this dialog to the display and + _(Move this dialog to the display and workspace you want to edit the settings for.)); gtk_widget_set_visible(panel-infobar, TRUE); } diff --git a/settings/xfdesktop-settings-appearance-frame-ui.glade b/settings/xfdesktop-settings-appearance-frame-ui.glade index 5679253..ee534db 100644 --- a/settings/xfdesktop-settings-appearance-frame-ui.glade +++ b/settings/xfdesktop-settings-appearance-frame-ui.glade @@ -117,7 +117,7 @@ property name=visibleTrue/property property name=can_focusTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=tooltip-text translatable=yesChoose the folder to select wallpapers from/property +property name=tooltip-text translatable=yesChoose the folder to select wallpapers from./property property name=actionGTK_FILE_CHOOSER_ACTION_SELECT_FOLDER/property /object packing @@ -163,7 +163,7 @@ object class=GtkComboBoxText id=combo_style property name=visibleTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=tooltip-text translatable=yesSpecify how the image will be resized to fit the screen/property +property name=tooltip-text translatable=yesSpecify how the image will be resized to fit the screen./property items item translatable=yesNone/item item translatable=yesCentered/item @@ -204,7 +204,7 @@ object class=GtkComboBox id=combo_colors property name=visibleTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=tooltip-text translatable=yesSpecify the style of the color drawn behind the backdrop image/property +property name=tooltip-text translatable=yesSpecify the style
[Xfce4-commits] xfdesktop:master Show add/remove workspace option is on by default
Updating branch refs/heads/master to 755ae10f0b20bc4f105d9a35b2596bae956bc1ff (commit) from 05adaa59dbedd89b3e0ae6001ff367572c1be7d2 (commit) commit 755ae10f0b20bc4f105d9a35b2596bae956bc1ff Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 24 09:59:58 2014 +0300 Show add/remove workspace option is on by default settings/xfdesktop-settings-ui.glade |1 + 1 file changed, 1 insertion(+) diff --git a/settings/xfdesktop-settings-ui.glade b/settings/xfdesktop-settings-ui.glade index 0fef408..6ed21e0 100644 --- a/settings/xfdesktop-settings-ui.glade +++ b/settings/xfdesktop-settings-ui.glade @@ -494,6 +494,7 @@ property name=can_focusTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property property name=label translatable=yesShow a_dd and remove workspace options in list/property +property name=activeTrue/property property name=use_underlineTrue/property property name=draw_indicatorTrue/property /object ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix segfault on session start
Updating branch refs/heads/master to 6583a1a632779e72ba6ecfa32a10f30980081876 (commit) from bdc893fd97c8820f25d9b878ce97f28e6a43bfd1 (commit) commit 6583a1a632779e72ba6ecfa32a10f30980081876 Author: Thaddäus Tintenfisch thad.fi...@gmail.com Date: Sun Feb 23 09:02:58 2014 +0300 Fix segfault on session start Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfce-desktop.c |4 1 file changed, 4 insertions(+) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index aff857e..b076589 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1662,6 +1662,10 @@ xfce_desktop_refresh(XfceDesktop *desktop) if(!gtk_widget_get_realized(GTK_WIDGET(desktop))) return; +if(desktop-priv-workspaces == NULL) { +return; +} + current_workspace = xfce_desktop_get_current_workspace(desktop); /* reload backgrounds */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Remember the window size of the settings dialog.
Updating branch refs/heads/master to d309a6949b751002b33ed432f88fd47a1384db0e (commit) from 6583a1a632779e72ba6ecfa32a10f30980081876 (commit) commit d309a6949b751002b33ed432f88fd47a1384db0e Author: Harald Judt h.j...@gmx.at Date: Sat Feb 22 14:58:41 2014 +0100 Remember the window size of the settings dialog. Signed-off-by: Eric Koegel eric.koe...@gmail.com settings/main.c | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/settings/main.c b/settings/main.c index 9170ef0..a34256e 100644 --- a/settings/main.c +++ b/settings/main.c @@ -62,6 +62,9 @@ #define PREVIEW_WIDTH(PREVIEW_HEIGHT * MAX_ASPECT_RATIO) +#define SETTINGS_WINDOW_LAST_WIDTH /last/window-width +#define SETTINGS_WINDOW_LAST_HEIGHT /last/window-height + #define SHOW_DESKTOP_MENU_PROP /desktop-menu/show #define DESKTOP_MENU_SHOW_ICONS_PROP /desktop-menu/show-icons @@ -1931,12 +1934,27 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, } static void -xfdesktop_settings_response(GtkWidget *dialog, gint response_id) +xfdesktop_settings_response(GtkWidget *dialog, gint response_id, gpointer user_data) { if(response_id == GTK_RESPONSE_HELP) xfce_dialog_show_help(GTK_WINDOW(dialog), xfdesktop, preferences, NULL); -else +else { +XfconfChannel *channel = (XfconfChannel*) user_data; +GdkWindowState state; +gint width, height; + +/* don't save the state for full-screen windows */ +state = gdk_window_get_state(GTK_WIDGET(dialog)-window); + +if ((state (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) == 0) { +/* save window size */ +gtk_window_get_size(GTK_WINDOW(dialog), width, height); +xfconf_channel_set_int(channel, SETTINGS_WINDOW_LAST_WIDTH, width); +xfconf_channel_set_int(channel, SETTINGS_WINDOW_LAST_HEIGHT, height); +} + gtk_main_quit(); +} } static GdkNativeWindow opt_socket_id = 0; @@ -2017,7 +2035,12 @@ main(int argc, char **argv) GtkWidget *dialog; dialog = GTK_WIDGET(gtk_builder_get_object(gxml, prefs_dialog)); g_signal_connect(dialog, response, - G_CALLBACK(xfdesktop_settings_response), NULL); + G_CALLBACK(xfdesktop_settings_response), + channel); +gtk_window_set_default_size +(GTK_WINDOW(dialog), + xfconf_channel_get_int(channel, SETTINGS_WINDOW_LAST_WIDTH, -1), + xfconf_channel_get_int(channel, SETTINGS_WINDOW_LAST_HEIGHT, -1)); gtk_window_present(GTK_WINDOW (dialog)); screen = gtk_widget_get_screen(dialog); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop|xfdesktop-4.11.3 Creating annotated tag xfdesktop-4.11.3
Updating annotated tag refs/tags/xfdesktop-4.11.3 as new annotated tag to b71993f719a1320c1e817257399fdb29d009ecc8 (tag) succeeds xfdesktop-4.11.2-42-g9b9bacb tagged by Eric Koegel eric.koe...@gmail.com on 2014-02-19 18:54 +0100 Eric Koegel (1): Updates for release. ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Updates for release.
Updating branch refs/heads/master to ffb99ffdcc7926cae8b8d1bbee286c5797d28083 (commit) from 9b9bacb445ded5050ea073b9b1c784883a43456b (commit) commit ffb99ffdcc7926cae8b8d1bbee286c5797d28083 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Feb 19 20:54:05 2014 +0300 Updates for release. NEWS| 34 ++ configure.ac.in |4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index fa4481a..63e41a6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,37 @@ +4.11.3 +== +[Please note that this is a development release.] + +Fourth development release of xfdesktop targeting for Xfce 4.12. +Please report all problems at bugzilla.xfce.org. + +* Multi-monitor fixes: + - Release pixmap on screen changes + - Always redraw backdrop on display change. +Both patches were added so that transitions from one monitor +to another cause the backdrop to properly display. + +* Miscellaneous fixes: +- Update default icon size, spacing, and text proportion. +- Scale up small image previews in xfdesktop-settings (Bug 10690) +- Fix strict aliasing issue +- Check for thumbnails in the new location +- Fix issues with icon resizing +- Refresh desktop on style changes +- Fix potential bugs found with static code analysis tools +- Fix keyboard cursor movement in the icon view +- Fix some runtime warnings +- Ensure a quit signal causes xfdesktop to shutdown +- Fix icon labels in RTL languages (Bug 10604) +- Use get_folder_actions for clicks on the desktop itself +- Only use thunarx_menu_provider_get_file_actions (Bug 10492) + +* Translation updates: + Czech (cs), English (Australia) (en_AU), German (de), + Icelandic (is), Indonesian (id), Kazakh (kk), Malay (ms), + Polish (pl), Portuguese (pt), Russian (ru), Slovenian (sl), + Spanish (Castilian) (es), Swedish (sv), Turkish (tr), + 4.11.2 == [Please note that this is a development release.] diff --git a/configure.ac.in b/configure.ac.in index 4043d9f..3b79e3b 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -6,10 +6,10 @@ dnl dnl version info m4_define([xfdesktop_version_major], [4]) m4_define([xfdesktop_version_minor], [11]) -m4_define([xfdesktop_version_micro], [2]) +m4_define([xfdesktop_version_micro], [3]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[git]) +m4_define([xfdesktop_version_tag],[]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Post release tag bump.
Updating branch refs/heads/master to e613364882c606e337bb4036cd5a5b910967393a (commit) from ffb99ffdcc7926cae8b8d1bbee286c5797d28083 (commit) commit e613364882c606e337bb4036cd5a5b910967393a Author: Eric Koegel eric.koe...@gmail.com Date: Wed Feb 19 21:00:12 2014 +0300 Post release tag bump. configure.ac.in |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac.in b/configure.ac.in index 3b79e3b..1a0fe09 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -9,7 +9,7 @@ m4_define([xfdesktop_version_minor], [11]) m4_define([xfdesktop_version_micro], [3]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[]) +m4_define([xfdesktop_version_tag],[git]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Always redraw backdrop on display change
Updating branch refs/heads/master to 11990471655a1ea7277497c8c93b716b1a3a2749 (commit) from e0f355e0f031b9ab2cc19cb7a32fbc6a4722e8cd (commit) commit 11990471655a1ea7277497c8c93b716b1a3a2749 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 17 14:14:39 2014 +0300 Always redraw backdrop on display change When changing from a laptop display to an external monitor there are times where the wallpaper doesn't correcly update. This patch removes a couple checks that are preventing that update. src/xfce-desktop.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index b87bdf9..04887cc 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -598,7 +598,7 @@ workspace_changed_cb(WnckScreen *wnck_screen, { XfceDesktop *desktop = XFCE_DESKTOP(user_data); gint current_workspace, new_workspace, i; -XfceBackdrop *current_backdrop, *new_backdrop; +XfceBackdrop *new_backdrop; TRACE(entering); @@ -619,16 +619,11 @@ workspace_changed_cb(WnckScreen *wnck_screen, current_workspace, new_workspace); for(i = 0; i xfce_desktop_get_n_monitors(desktop); i++) { -/* We want to compare the current workspace backdrop with the new one - * and see if we can avoid changing them if they are the same image/style */ +/* Sanity check */ if(current_workspace desktop-priv-nworkspaces current_workspace = 0) { -current_backdrop = xfce_workspace_get_backdrop(desktop-priv-workspaces[current_workspace], i); +/* update! */ new_backdrop = xfce_workspace_get_backdrop(desktop-priv-workspaces[new_workspace], i); - -if(!xfce_backdrop_compare_backdrops(current_backdrop, new_backdrop) || !desktop-priv-bg_pixmap) { -/* only update monitors that require it */ -backdrop_changed_cb(new_backdrop, user_data); -} +backdrop_changed_cb(new_backdrop, user_data); } else { /* If current_workspace was removed or never existed, get the new * backdrop and apply it */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Release pixmap on screen changes
Updating branch refs/heads/master to 9b9bacb445ded5050ea073b9b1c784883a43456b (commit) from 11990471655a1ea7277497c8c93b716b1a3a2749 (commit) commit 9b9bacb445ded5050ea073b9b1c784883a43456b Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 17 15:26:42 2014 +0300 Release pixmap on screen changes Since the screen may have changed dimensions (i.e. change from lvds to hdmi display) we need to release the previous pixmap to reflect those changes. src/xfce-desktop.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 04887cc..aff857e 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -534,6 +534,12 @@ screen_size_changed_cb(GdkScreen *gscreen, gpointer user_data) if(current_workspace 0) return; +/* release the bg_pixmap since the dimensions may have changed */ +if(desktop-priv-bg_pixmap) { +g_object_unref(desktop-priv-bg_pixmap); +desktop-priv-bg_pixmap = NULL; +} + /* special case for 1 backdrop to handle xinerama stretching */ if(xfce_workspace_get_xinerama_stretch(desktop-priv-workspaces[current_workspace])) { backdrop_changed_cb(xfce_workspace_get_backdrop(desktop-priv-workspaces[current_workspace], 0), desktop); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Scale up small image previews in xfdesktop-settings (Bug 10690)
Updating branch refs/heads/master to e0f355e0f031b9ab2cc19cb7a32fbc6a4722e8cd (commit) from 9a7ea5a209faa3fd43ae9bc85a86491207897af3 (commit) commit e0f355e0f031b9ab2cc19cb7a32fbc6a4722e8cd Author: Eric Koegel eric.koe...@gmail.com Date: Sun Feb 16 17:22:15 2014 +0300 Scale up small image previews in xfdesktop-settings (Bug 10690) While it looks worse with small images, scaling up the previews makes icon selections more accessible when using the mouse. settings/main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/settings/main.c b/settings/main.c index 41e4d5c..9170ef0 100644 --- a/settings/main.c +++ b/settings/main.c @@ -181,13 +181,13 @@ xfdesktop_settings_do_single_preview(GtkTreeModel *model, /* If we didn't create a thumbnail there might not be a thumbnailer service * or it may not support that format */ if(thumbnail == NULL) { -pix = exo_gdk_pixbuf_new_from_file_at_max_size(filename, - PREVIEW_WIDTH, PREVIEW_HEIGHT, - TRUE, NULL); +pix = gdk_pixbuf_new_from_file_at_scale(filename, +PREVIEW_WIDTH, PREVIEW_HEIGHT, +TRUE, NULL); } else { -pix = exo_gdk_pixbuf_new_from_file_at_max_size(thumbnail, - PREVIEW_WIDTH, PREVIEW_HEIGHT, - TRUE, NULL); +pix = gdk_pixbuf_new_from_file_at_scale(thumbnail, +PREVIEW_WIDTH, PREVIEW_HEIGHT, +TRUE, NULL); g_free(thumbnail); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Revert Simplify adding icons to the desktop
Updating branch refs/heads/master to 9a7ea5a209faa3fd43ae9bc85a86491207897af3 (commit) from 8ae12c53e5fde26fc7e635fff10e02ec22be5cd3 (commit) commit 9a7ea5a209faa3fd43ae9bc85a86491207897af3 Author: Eric Koegel eric.koe...@gmail.com Date: Tue Feb 11 11:33:12 2014 +0300 Revert Simplify adding icons to the desktop This reverts commit e339463f95c70578aae33f339ac54433f51cc5ae. This patch had the added feature of crashing xfdesktop when the icon size shrinks. Reverting to clean up the patch. src/xfdesktop-file-icon-manager.c | 35 --- src/xfdesktop-file-icon-manager.h |4 +- src/xfdesktop-icon-view-manager.c |8 +- src/xfdesktop-icon-view-manager.h | 16 +-- src/xfdesktop-icon-view.c | 198 ++--- src/xfdesktop-icon.c | 12 +-- src/xfdesktop-icon.h |8 +- src/xfdesktop-window-icon.c |2 +- 8 files changed, 138 insertions(+), 145 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 7a54d18..9e9ad3c 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -162,14 +162,14 @@ static void xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager); static gboolean xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager, XfdesktopIcon *drop_icon, GdkDragContext *context, - gint row, - gint col, + guint16 row, + guint16 col, guint time_); static void xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager, XfdesktopIcon *drop_icon, GdkDragContext *context, - gint row, - gint col, + guint16 row, + guint16 col, GtkSelectionData *data, guint info, guint time_); @@ -1723,7 +1723,7 @@ file_icon_hash_write_icons(gpointer key, { XfceRc *rcfile = data; XfdesktopIcon *icon = value; -gint row, col; +guint16 row, col; gchar *identifier = xfdesktop_icon_get_identifier(icon); if(xfdesktop_icon_get_position(icon, row, col)) { @@ -1832,8 +1832,8 @@ gboolean xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *fmanager, const gchar *name, const gchar *identifier, - gint *row, - gint *col) + gint16 *row, + gint16 *col) { gchar relpath[PATH_MAX]; gchar *filename = NULL; @@ -2055,7 +2055,7 @@ process_icon_from_queue(gpointer user_data) static void xfdesktop_file_icon_manager_add_icon(XfdesktopFileIconManager *fmanager, XfdesktopFileIcon *icon, - gint row, gint col) + gint16 row, gint16 col) { const gchar *name; gchar *identifier; @@ -2081,12 +2081,11 @@ xfdesktop_file_icon_manager_add_icon(XfdesktopFileIconManager *fmanager, name, identifier, row, col)) { -DBG(attempting to set icon '%s' to cached position (%d,%d), name, row, col); +DBG(attempting to set icon '%s' to position (%d,%d), name, row, col); xfdesktop_icon_set_position(XFDESKTOP_ICON(icon), row, col); g_queue_push_head(fmanager-priv-pending_icons, icon); } else { /* Didn't have a spot, push it to the end of the stack */ -xfdesktop_icon_set_position(XFDESKTOP_ICON(icon), row, col); g_queue_push_tail(fmanager-priv-pending_icons, icon); } @@ -2147,7 +2146,7 @@ static XfdesktopFileIcon * xfdesktop_file_icon_manager_add_regular_icon(XfdesktopFileIconManager *fmanager, GFile *file, GFileInfo *info
[Xfce4-commits] xfdesktop:master Simplify adding icons to the desktop
Updating branch refs/heads/master to e339463f95c70578aae33f339ac54433f51cc5ae (commit) from 9cec4dbbd0dcd9f1d6a0e247a64c133324c6a9c2 (commit) commit e339463f95c70578aae33f339ac54433f51cc5ae Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 10 15:07:29 2014 +0300 Simplify adding icons to the desktop Use xfdesktop_grid_get_next_free_position when placing icons on the desktop rather than having it spead over multiple functions. src/xfdesktop-file-icon-manager.c | 35 +++ src/xfdesktop-file-icon-manager.h |4 +- src/xfdesktop-icon-view-manager.c |8 +- src/xfdesktop-icon-view-manager.h | 16 +-- src/xfdesktop-icon-view.c | 198 +++-- src/xfdesktop-icon.c | 12 +-- src/xfdesktop-icon.h |8 +- src/xfdesktop-window-icon.c |2 +- 8 files changed, 145 insertions(+), 138 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 9e9ad3c..7a54d18 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -162,14 +162,14 @@ static void xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager); static gboolean xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager, XfdesktopIcon *drop_icon, GdkDragContext *context, - guint16 row, - guint16 col, + gint row, + gint col, guint time_); static void xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager, XfdesktopIcon *drop_icon, GdkDragContext *context, - guint16 row, - guint16 col, + gint row, + gint col, GtkSelectionData *data, guint info, guint time_); @@ -1723,7 +1723,7 @@ file_icon_hash_write_icons(gpointer key, { XfceRc *rcfile = data; XfdesktopIcon *icon = value; -guint16 row, col; +gint row, col; gchar *identifier = xfdesktop_icon_get_identifier(icon); if(xfdesktop_icon_get_position(icon, row, col)) { @@ -1832,8 +1832,8 @@ gboolean xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *fmanager, const gchar *name, const gchar *identifier, - gint16 *row, - gint16 *col) + gint *row, + gint *col) { gchar relpath[PATH_MAX]; gchar *filename = NULL; @@ -2055,7 +2055,7 @@ process_icon_from_queue(gpointer user_data) static void xfdesktop_file_icon_manager_add_icon(XfdesktopFileIconManager *fmanager, XfdesktopFileIcon *icon, - gint16 row, gint16 col) + gint row, gint col) { const gchar *name; gchar *identifier; @@ -2081,11 +2081,12 @@ xfdesktop_file_icon_manager_add_icon(XfdesktopFileIconManager *fmanager, name, identifier, row, col)) { -DBG(attempting to set icon '%s' to position (%d,%d), name, row, col); +DBG(attempting to set icon '%s' to cached position (%d,%d), name, row, col); xfdesktop_icon_set_position(XFDESKTOP_ICON(icon), row, col); g_queue_push_head(fmanager-priv-pending_icons, icon); } else { /* Didn't have a spot, push it to the end of the stack */ +xfdesktop_icon_set_position(XFDESKTOP_ICON(icon), row, col); g_queue_push_tail(fmanager-priv-pending_icons, icon); } @@ -2146,7 +2147,7 @@ static XfdesktopFileIcon * xfdesktop_file_icon_manager_add_regular_icon(XfdesktopFileIconManager *fmanager, GFile *file, GFileInfo *info, - guint16 row, guint16 col
[Xfce4-commits] xfdesktop:master Fix strict aliasing issue
Updating branch refs/heads/master to 369fe226968f678faf255805f5285665f20e03af (commit) from e339463f95c70578aae33f339ac54433f51cc5ae (commit) commit 369fe226968f678faf255805f5285665f20e03af Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 10 16:06:21 2014 +0300 Fix strict aliasing issue src/xfdesktop-icon-view.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 8f64603..a7f1faa 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -3405,7 +3405,7 @@ xfdesktop_get_workarea_single(XfdesktopIconView *icon_view, Window root; Atom property, actual_type = None; gint actual_format = 0, first_id; -gulong nitems = 0, bytes_after = 0, offset = 0; +gulong nitems = 0, bytes_after = 0, offset = 0, tmp_size = 0; unsigned char *data_p = NULL; g_return_val_if_fail(xorigin yorigin @@ -3427,12 +3427,20 @@ xfdesktop_get_workarea_single(XfdesktopIconView *icon_view, bytes_after, data_p)) { gint i; -gulong *data = (gulong *)data_p; - +gulong *data; + if(actual_format != 32 || actual_type != XA_CARDINAL) { XFree(data_p); break; } + +tmp_size = (actual_format / 8) * nitems; +if(actual_format == 32) { +tmp_size *= sizeof(long)/4; +} + +data = g_malloc(tmp_size); +memcpy(data, data_p, tmp_size); i = offset / 32; /* first element id in this batch */ @@ -3447,11 +3455,13 @@ xfdesktop_get_workarea_single(XfdesktopIconView *icon_view, *height = data[first_id - offset + 3] - 2 * SCREEN_MARGIN; ret = TRUE; XFree(data_p); +g_free(data); break; } offset += actual_format * nitems; XFree(data_p); +g_free(data); } else break; } while(bytes_after 0); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master update README with new defaults
Updating branch refs/heads/master to 8ae12c53e5fde26fc7e635fff10e02ec22be5cd3 (commit) from 09f4a5e334a6858369ea69cc62ddd381250c9d62 (commit) commit 8ae12c53e5fde26fc7e635fff10e02ec22be5cd3 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 10 22:15:25 2014 +0300 update README with new defaults README |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 75a4905..0050aa1 100644 --- a/README +++ b/README @@ -52,9 +52,9 @@ style xfdesktop-icon-view { XfdesktopIconView::selected-shadow-y-offset = 2 XfdesktopIconView::selected-shadow-color = #00ff00 -XfdesktopIconView::cell-spacing = 6 +XfdesktopIconView::cell-spacing = 2 XfdesktopIconView::cell-padding = 6 -XfdesktopIconView::cell-text-width-proportion = 2.5 +XfdesktopIconView::cell-text-width-proportion = 1.9 base[NORMAL] = #00ff00 base[SELECTED] = #5050ff ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Update default icon size, spacing, and text proportion
Updating branch refs/heads/master to 09f4a5e334a6858369ea69cc62ddd381250c9d62 (commit) from 03900b4256dcd4e597882fa7116da3b2d7b56001 (commit) commit 09f4a5e334a6858369ea69cc62ddd381250c9d62 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 10 22:05:27 2014 +0300 Update default icon size, spacing, and text proportion common/xfdesktop-common.h|2 +- settings/xfdesktop-settings-ui.glade |2 +- src/xfdesktop-icon-view.c|5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index f73606a..0c4c6fc 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -35,7 +35,7 @@ #define XFDESKTOP_CHANNELxfce4-desktop #define DEFAULT_BACKDROP DATADIR /backgrounds/xfce/xfce-blue.jpg #define DEFAULT_ICON_FONT_SIZE 12 -#define DEFAULT_ICON_SIZE32 +#define DEFAULT_ICON_SIZE48 #define ITHEME_FLAGS (GTK_ICON_LOOKUP_USE_BUILTIN \ | GTK_ICON_LOOKUP_GENERIC_FALLBACK) diff --git a/settings/xfdesktop-settings-ui.glade b/settings/xfdesktop-settings-ui.glade index 9630a31..0fef408 100644 --- a/settings/xfdesktop-settings-ui.glade +++ b/settings/xfdesktop-settings-ui.glade @@ -7,7 +7,7 @@ property name=page_increment10/property property name=step_increment1/property property name=page_size0/property -property name=value36/property +property name=value48/property /object object class=GtkAdjustment id=adjustment4 property name=upper144/property diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index a7f1faa..1b3b9a1 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -53,7 +53,6 @@ #include xfconf/xfconf.h #define DEFAULT_FONT_SIZE 12 -#define DEFAULT_ICON_SIZE 32 #define DEFAULT_TOOLTIP_SIZE 128 #define MAX_TOOLTIP_SIZE 512 @@ -556,7 +555,7 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass) g_param_spec_int(cell-spacing, Cell spacing, Spacing between desktop icon cells, - 0, 255, 6, + 0, 255, 2, G_PARAM_READABLE)); gtk_widget_class_install_style_property(widget_class, @@ -571,7 +570,7 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass) Cell text width proportion, Width of text in desktop icon cell, calculated as multiplier of the icon size, -1.0, 10.0, 2.5, +1.0, 10.0, 1.9, G_PARAM_READABLE)); gtk_widget_class_install_style_property(widget_class, g_param_spec_boolean(ellipsize-icon-labels, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches xfpm-power-info: add current percentage of batteries
Updating branch refs/heads/eric/bugzilla-patches to bb1b43e8f608daf05110432f30dd3c4d411470ad (commit) from 1e2b996f5e9c6da6fd2f6ba1ad5d82a3552adf89 (commit) commit bb1b43e8f608daf05110432f30dd3c4d411470ad Author: Stefan Seyfried seife+...@b1-systems.com Date: Fri Apr 27 11:38:59 2012 +0200 xfpm-power-info: add current percentage of batteries a bluetooth mouse's battery might not have any Energy* properties (all zero), but a Percentage property, so it might be useful to show that. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfpm-power-info.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/xfpm-power-info.c b/src/xfpm-power-info.c index f0c9e50..a53a6be 100644 --- a/src/xfpm-power-info.c +++ b/src/xfpm-power-info.c @@ -410,6 +410,20 @@ xfpm_info_add_device_view (XfpmInfo *info, GHashTable *props, const gchar *objec i++; } + value = g_hash_table_lookup (props, Percentage); + + if ( value ) + { + str = g_strdup_printf(%d, (guint) g_value_get_double (value)); + gtk_list_store_append (list_store, iter); + gtk_list_store_set (list_store, iter, + XFPM_DEVICE_INFO_NAME, _(Energy percent), + XFPM_DEVICE_INFO_VALUE, str, + -1); + i++; + g_free(str); + } + /* TRANSLATORS: Unit here is What hour*/ str = xfpm_info_get_energy_property (props, EnergyFullDesign, _(Wh)); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches xfpm-battery: do not show an icon for HID devices
Updating branch refs/heads/eric/bugzilla-patches to f691bf19ef81df90008af72efbac5441ca68bad4 (commit) from bb1b43e8f608daf05110432f30dd3c4d411470ad (commit) commit f691bf19ef81df90008af72efbac5441ca68bad4 Author: Stefan Seyfried seife+...@b1-systems.com Date: Fri Apr 27 11:03:17 2012 +0200 xfpm-battery: do not show an icon for HID devices my bluetooth mouse always shows up as a second battery which is not too useful -- ignore devices starting with hid- TODO: check if this affects UPSs. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfpm-battery.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index 31576d6..2034c60 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -608,10 +608,25 @@ static void xfpm_battery_changed_cb (DBusGProxy *proxy, XfpmBattery *battery) { GHashTable *props; +GValue *value; +const gchar *cstr; +const gchar *p; props = xfpm_power_get_interface_properties (battery-priv-proxy_prop, UPOWER_IFACE_DEVICE); +value = g_hash_table_lookup (props, NativePath); +if ( value ) +{ + cstr = g_value_get_string (value); + p = strrchr (cstr, '/'); + if ( p (strncmp( p, /hid-, 5 ) == 0) ) + { + XFPM_DEBUG(Ignoring battery '%s' - is a HID device\n, cstr); + return; + } +} + if ( props ) xfpm_battery_refresh (battery, props); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Check for thumbnails in the new location
Updating branch refs/heads/master to 21e242639b81e0d7ae0a6c7e922b78149ff2deab (commit) from 3706a99fcf96557107b9f422463dc721f64ba616 (commit) commit 21e242639b81e0d7ae0a6c7e922b78149ff2deab Author: Eric Koegel eric.koe...@gmail.com Date: Sun Feb 9 20:01:33 2014 +0300 Check for thumbnails in the new location The thumbnail managing standard was updated to change the location where thumbnails are sometimes stored. This has been changed to $XDG_CACHE_HOME/thumbnails/ unless $XDG_CACHE_HOME isn't defined, at which point it's back to $HOME/.cache/thumbnails . This patch has xfdesktop look in both places when the thumbnail is created and reports the first one that's found. common/xfdesktop-thumbnailer.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c index f49edb2..2ebf006 100644 --- a/common/xfdesktop-thumbnailer.c +++ b/common/xfdesktop-thumbnailer.c @@ -531,7 +531,11 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, if(strcmp (uri[x], f_uri) == 0) { /* The thumbnail is in the format/location + * $XDG_CACHE_HOME/thumbnails/(nromal|large)/MD5_Hash_Of_URI.png + * for version 0.8.0 if XDG_CACHE_HOME is defined, otherwise * /homedir/.thumbnails/(normal|large)/MD5_Hash_Of_URI.png + * will be used, which is also always used for versions prior + * to 0.7.0. */ f_uri_checksum = g_compute_checksum_for_string(G_CHECKSUM_MD5, f_uri, strlen (f_uri)); @@ -543,10 +547,20 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, filename = g_strconcat(f_uri_checksum, .png, NULL); -thumbnail_location = g_build_path(/, g_get_home_dir(), - .thumbnails, thumbnail_flavor, +/* build and check if the thumbnail is in the new location */ +thumbnail_location = g_build_path(/, g_get_user_cache_dir(), + thumbnails, thumbnail_flavor, filename, NULL); +if(!g_file_test(thumbnail_location, G_FILE_TEST_EXISTS)) { +/* Fallback to old version */ +g_free(thumbnail_location); + +thumbnail_location = g_build_path(/, g_get_home_dir(), + .thumbnails, thumbnail_flavor, + filename, NULL); +} + DBG(thumbnail-ready src: %s thumbnail: %s, (char*)iter-data, thumbnail_location); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Scale down special icons (Bug 10653)
Updating branch refs/heads/master to 9160a163e60bda06f5a1f550b5c04f846ff3817a (commit) from c585aff2aaf90e0c9350355b0096371f3cdc679a (commit) commit 9160a163e60bda06f5a1f550b5c04f846ff3817a Author: Eric Koegel eric.koe...@gmail.com Date: Mon Feb 3 15:38:20 2014 +0300 Scale down special icons (Bug 10653) gtk_icon_theme_lookup_by_gicon only returns icons that are close to what we requested. So scale those icons down if it is requred. Same fix as commit 596ac7b07939b3b93c6253b2db704a91e68e75d0 src/xfdesktop-file-utils.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c index 91ab61e..8fbd4a7 100644 --- a/src/xfdesktop-file-utils.c +++ b/src/xfdesktop-file-utils.c @@ -409,10 +409,17 @@ xfdesktop_file_utils_get_icon(GIcon *icon, if(pix_theme) { +GdkPixbuf *tmp; /* we can't edit thsese icons */ -pix = gdk_pixbuf_copy(pix_theme); +tmp = gdk_pixbuf_copy(pix_theme); + +/* ensure icons are within our size requirements since + * gtk_icon_theme_lookup_by_gicon isn't exact */ +pix = exo_gdk_pixbuf_scale_down(tmp, TRUE, width, height); + +g_object_unref(G_OBJECT(tmp)); g_object_unref(G_OBJECT(pix_theme)); -pix_theme = NULL; +pix_theme = tmp = NULL; } /* fallback */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix issues with icon resizing
Updating branch refs/heads/master to b730aad939db6b8ab5b99e5e4873c7540f7e2be0 (commit) from 983a5d601273ab2ef61bc437d655f999c45b8e01 (commit) commit b730aad939db6b8ab5b99e5e4873c7540f7e2be0 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Jan 27 12:17:38 2014 +0300 Fix issues with icon resizing src/xfdesktop-icon-view.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 03c5acd..0bbfc3d 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -2680,10 +2680,10 @@ static void xfdesktop_setup_grids(XfdesktopIconView *icon_view) { gint xorigin = 0, yorigin = 0, width = 0, height = 0; -guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; gsize old_size, new_size; -old_size = total_cells * sizeof(XfdesktopIcon *); +old_size = (guint)icon_view-priv-nrows * icon_view-priv-ncols + * sizeof(XfdesktopIcon *); if(!xfdesktop_get_workarea_single(icon_view, 0, xorigin, yorigin, @@ -2706,10 +2706,8 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view) DBG(CELL_SIZE=%0.3f, TEXT_WIDTH=%0.3f, ICON_SIZE=%u, CELL_SIZE, TEXT_WIDTH, ICON_SIZE); DBG(grid size is %dx%d, icon_view-priv-nrows, icon_view-priv-ncols); -/* recalculate */ -total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; - -new_size = total_cells * sizeof(XfdesktopIcon *); +new_size = (guint)icon_view-priv-nrows * icon_view-priv-ncols + * sizeof(XfdesktopIcon *); if(icon_view-priv-grid_layout) { icon_view-priv-grid_layout = g_realloc(icon_view-priv-grid_layout, @@ -3219,7 +3217,6 @@ static void xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view) { GList *l = NULL; -guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; /* move all icons into the pending_icons list and remove from the desktop */ for(l = icon_view-priv-icons; l; l = l-next) { @@ -3237,7 +3234,8 @@ xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view) icon_view-priv-icons = NULL; memset(icon_view-priv-grid_layout, 0, - total_cells * sizeof(XfdesktopIcon *)); + (guint)icon_view-priv-nrows * icon_view-priv-ncols + * sizeof(XfdesktopIcon *)); xfdesktop_setup_grids(icon_view); } @@ -3373,8 +3371,6 @@ xfdesktop_move_all_pending_icons_to_desktop(XfdesktopIconView *icon_view) static void xfdesktop_grid_do_resize(XfdesktopIconView *icon_view) { -guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; - xfdesktop_move_all_icons_to_pending_icons_list(icon_view); #if 0 /*def DEBUG*/ @@ -3382,7 +3378,8 @@ xfdesktop_grid_do_resize(XfdesktopIconView *icon_view) #endif memset(icon_view-priv-grid_layout, 0, - total_cells * sizeof(XfdesktopIcon *)); + (guint)icon_view-priv-nrows * icon_view-priv-ncols + * sizeof(XfdesktopIcon *)); xfdesktop_setup_grids(icon_view); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix some more potential bugs
Updating branch refs/heads/master to 3aeedbb076b1315b56e43e798694425657569abe (commit) from cad4ddfa7d735b62099c9716e99821536a02b006 (commit) commit 3aeedbb076b1315b56e43e798694425657569abe Author: Eric Koegel eric.koe...@gmail.com Date: Sat Jan 25 21:32:26 2014 +0300 Fix some more potential bugs An unchecked return value, unintended sign extensions, and a copy paste error. src/xfdesktop-file-icon-manager.c |2 +- src/xfdesktop-icon-view.c | 27 --- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 7870635..9e9ad3c 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2487,7 +2487,7 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, if(moved_icon) { /* Since we're replacing an existing icon, get that location * to use instead */ -if(!xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col)) { +if(!xfdesktop_icon_get_position(XFDESKTOP_ICON(moved_icon), row, col)) { /* Failed to get position... not supported? */ row = col = 0; } diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 5b81528..03c5acd 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -2680,10 +2680,10 @@ static void xfdesktop_setup_grids(XfdesktopIconView *icon_view) { gint xorigin = 0, yorigin = 0, width = 0, height = 0; +guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; gsize old_size, new_size; -old_size = icon_view-priv-nrows * icon_view-priv-ncols - * sizeof(XfdesktopIcon *); +old_size = total_cells * sizeof(XfdesktopIcon *); if(!xfdesktop_get_workarea_single(icon_view, 0, xorigin, yorigin, @@ -2705,10 +2705,12 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view) DBG(CELL_SIZE=%0.3f, TEXT_WIDTH=%0.3f, ICON_SIZE=%u, CELL_SIZE, TEXT_WIDTH, ICON_SIZE); DBG(grid size is %dx%d, icon_view-priv-nrows, icon_view-priv-ncols); - -new_size = icon_view-priv-nrows * icon_view-priv-ncols - * sizeof(XfdesktopIcon *); - + +/* recalculate */ +total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; + +new_size = total_cells * sizeof(XfdesktopIcon *); + if(icon_view-priv-grid_layout) { icon_view-priv-grid_layout = g_realloc(icon_view-priv-grid_layout, new_size); @@ -3217,6 +3219,7 @@ static void xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view) { GList *l = NULL; +guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; /* move all icons into the pending_icons list and remove from the desktop */ for(l = icon_view-priv-icons; l; l = l-next) { @@ -3234,8 +3237,7 @@ xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view) icon_view-priv-icons = NULL; memset(icon_view-priv-grid_layout, 0, - icon_view-priv-nrows * icon_view-priv-ncols - * sizeof(XfdesktopIcon *)); + total_cells * sizeof(XfdesktopIcon *)); xfdesktop_setup_grids(icon_view); } @@ -3312,7 +3314,9 @@ xfdesktop_move_all_previous_icons_to_desktop(XfdesktopIconView *icon_view) guint16 row, col; XfdesktopIcon *icon = XFDESKTOP_ICON(l-data); -xfdesktop_icon_get_position(icon, row, col); +if(!xfdesktop_icon_get_position(icon, row, col)) { +g_warning(Trying to set previous position of an icon with no position); +} if(xfdesktop_grid_is_free_position(icon_view, row, col)) { DBG(adding icon %s position row %d x col %d, @@ -3369,6 +3373,8 @@ xfdesktop_move_all_pending_icons_to_desktop(XfdesktopIconView *icon_view) static void xfdesktop_grid_do_resize(XfdesktopIconView *icon_view) { +guint total_cells = (guint)icon_view-priv-nrows * icon_view-priv-ncols; + xfdesktop_move_all_icons_to_pending_icons_list(icon_view); #if 0 /*def DEBUG*/ @@ -3376,8 +3382,7 @@ xfdesktop_grid_do_resize(XfdesktopIconView *icon_view) #endif memset(icon_view-priv-grid_layout, 0, - icon_view-priv-nrows * icon_view-priv-ncols - * sizeof(XfdesktopIcon *)); + total_cells * sizeof(XfdesktopIcon *)); xfdesktop_setup_grids(icon_view); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Refresh desktop on style changes
Updating branch refs/heads/master to 1516cb96c6ec9b20b63f05e7bcc4af8594d43129 (commit) from 9628995ae4ae767591de3a31fb98ef233852617e (commit) commit 1516cb96c6ec9b20b63f05e7bcc4af8594d43129 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Jan 25 18:33:19 2014 +0300 Refresh desktop on style changes Xfdestkop's icon view doesn't update the icon labels when xfsettingsd starts up. To work around that, refresh the desktop on a style change event. Additionally gtk likes to send up to 10 style change events at once, so this also adds a 1 second delay to ensure it's the last change event that we respond to. src/xfce-desktop.c | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 7ae3e0c..b87bdf9 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -114,6 +114,7 @@ struct _XfceDesktopPriv gboolean icons_font_size_set; guint icons_font_size; guint icons_size; +gint style_refresh_timer; GtkWidget *icon_view; gdouble system_font_size; #endif @@ -889,6 +890,9 @@ xfce_desktop_finalize(GObject *object) g_object_unref(G_OBJECT(desktop-priv-channel)); g_free(desktop-priv-property_prefix); +if(desktop-priv-style_refresh_timer != 0) +g_source_remove(desktop-priv-style_refresh_timer); + G_OBJECT_CLASS(xfce_desktop_parent_class)-finalize(object); } @@ -1248,28 +1252,26 @@ xfce_desktop_delete_event(GtkWidget *w, return TRUE; } +static gboolean +style_refresh_cb(gpointer *w) +{ +XfceDesktop *desktop = XFCE_DESKTOP(w); + +xfce_desktop_refresh(desktop); +desktop-priv-style_refresh_timer = 0; + +return FALSE; +} + static void -xfce_desktop_style_set(GtkWidget *w, - GtkStyle *old_style) +xfce_desktop_style_set(GtkWidget *w, GtkStyle *old_style) { XfceDesktop *desktop = XFCE_DESKTOP(w); -#ifdef ENABLE_DESKTOP_ICONS -gdouble old_font_size; -#endif - -if(GDK_IS_WINDOW(desktop-priv-bg_pixmap)) -gdk_window_set_back_pixmap(gtk_widget_get_window(w), desktop-priv-bg_pixmap, FALSE); -gtk_widget_queue_draw(w); -#ifdef ENABLE_DESKTOP_ICONS -old_font_size = desktop-priv-system_font_size; -if(xfce_desktop_ensure_system_font_size(desktop) != old_font_size -desktop-priv-icon_view !desktop-priv-icons_font_size_set) -{ - xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop-priv-icon_view), - desktop-priv-system_font_size); -} -#endif +if(desktop-priv-style_refresh_timer != 0) +g_source_remove(desktop-priv-style_refresh_timer); + +desktop-priv-style_refresh_timer = g_timeout_add_seconds(1, (GSourceFunc)style_refresh_cb, w); } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix some potential bugs
Updating branch refs/heads/master to 78393c501d071ec05986d62b210b26e0170942ad (commit) from da61495218044db15bf95c4f2184ec969dc50c7a (commit) commit 78393c501d071ec05986d62b210b26e0170942ad Author: Eric Koegel eric.koe...@gmail.com Date: Sat Jan 25 08:32:29 2014 +0300 Fix some potential bugs Correct some of the issues found with coverity scan. Things like an unused pointer, variables that could potentially be used in an uninitialized state, a copy-paste error, and a couple spots where the return value wasn't checked. common/xfdesktop-thumbnailer.c| 10 +- settings/main.c |4 ++-- src/xfce-workspace.c |2 +- src/xfdesktop-file-icon-manager.c | 12 +--- src/xfdesktop-file-utils.c|2 +- src/xfdesktop-icon-view.c | 13 + src/xfdesktop-volume-icon.c |1 - 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c index 248a3c5..f49edb2 100644 --- a/common/xfdesktop-thumbnailer.c +++ b/common/xfdesktop-thumbnailer.c @@ -216,13 +216,13 @@ xfdesktop_thumbnailer_dispose(GObject *object) { XfdesktopThumbnailer *thumbnailer = XFDESKTOP_THUMBNAILER(object); -if(thumbnailer-priv-proxy) -g_object_unref(thumbnailer-priv-proxy); +if(thumbnailer-priv) { +if(thumbnailer-priv-proxy) +g_object_unref(thumbnailer-priv-proxy); -if(thumbnailer-priv-supported_mimetypes) -g_free(thumbnailer-priv-supported_mimetypes); +if(thumbnailer-priv-supported_mimetypes) +g_free(thumbnailer-priv-supported_mimetypes); -if(thumbnailer-priv) { g_free(thumbnailer-priv); thumbnailer-priv = NULL; } diff --git a/settings/main.c b/settings/main.c index dec5ea4..41e4d5c 100644 --- a/settings/main.c +++ b/settings/main.c @@ -1276,12 +1276,12 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, /* If the first color doesn't exist, try to load the old one */ if(!xfconf_channel_has_property(channel, buf)) { GValue value = { 0, }; -old_property = xfdesktop_settings_generate_old_binding_string(panel, color1); +old_property = xfdesktop_settings_generate_old_binding_string(panel, color2); xfconf_channel_get_property(channel, old_property, value); if(G_VALUE_HOLDS_BOXED(value)) { -gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), +gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color2_btn), g_value_get_boxed(value)); g_value_unset(value); } else { diff --git a/src/xfce-workspace.c b/src/xfce-workspace.c index 0a9f84a..13aa924 100644 --- a/src/xfce-workspace.c +++ b/src/xfce-workspace.c @@ -145,7 +145,7 @@ xfce_workspace_change_backdrop(XfceWorkspace *workspace, XfconfChannel *channel = workspace-priv-channel; char buf[1024]; gchar *monitor_name = NULL; -guint i, monitor_num; +guint i, monitor_num = 0; g_return_if_fail(workspace-priv-nbackdrops 0); diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index a3201e6..7870635 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2456,7 +2456,7 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data); XfdesktopFileIcon *icon, *moved_icon; GFileInfo *file_info; -guint16 row, col; +guint16 row = 0, col = 0; gchar *filename; switch(event) { @@ -2470,7 +2470,10 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, if(icon) { /* Get the old position so we can use it for the new icon */ -xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col); +if(!xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col)) { +/* Failed to get position... not supported? */ +row = col = 0; +} DBG(row %d, col %d, row, col); /* Remove the old icon */ @@ -2484,7 +2487,10 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, if(moved_icon) { /* Since we're replacing an existing icon, get that location * to use instead */ -xfdesktop_icon_get_position(XFDESKTOP_ICON(moved_icon), row, col); +if(!xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col)) { +/* Failed to get position... not supported? */ +row = col = 0; +} DBG(row %d, col %d, row, col); xfdesktop_file_icon_manager_remove_icon(fmanager
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Don't allow systemd to handle suspend/hibernate events.
Updating branch refs/heads/eric/bugzilla-patches to 1e2b996f5e9c6da6fd2f6ba1ad5d82a3552adf89 (commit) from fbf8daf3709bd9fedbe251b6faaeebafcf02f830 (commit) commit 1e2b996f5e9c6da6fd2f6ba1ad5d82a3552adf89 Author: Mikhail Efremov s...@altlinux.org Date: Thu Feb 21 15:03:44 2013 +0400 Don't allow systemd to handle suspend/hibernate events. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfpm-main.c | 87 +-- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/src/xfpm-main.c b/src/xfpm-main.c index 40959c8..24dacae 100644 --- a/src/xfpm-main.c +++ b/src/xfpm-main.c @@ -194,16 +194,96 @@ xfpm_dump_remote (DBusGConnection *bus) g_hash_table_destroy (hash); } +static gint +xfpm_inhibit_sleep_systemd (DBusGConnection *bus) +{ +DBusConnection *bus_connection; +DBusMessage *message = NULL, *reply = NULL; +DBusError error; +gint fd = -1; +const char *what = handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch; +const char *who = xfce4-power-manager; +const char *why = xfce4-power-manager handles these events; +const char *mode = block; + +bus_connection = dbus_g_connection_get_connection (bus); +if (!xfpm_dbus_name_has_owner (bus_connection, org.freedesktop.login1)) +return -1; + +dbus_error_init (error); + +message = dbus_message_new_method_call (org.freedesktop.login1, +/org/freedesktop/login1, +org.freedesktop.login1.Manager, +Inhibit); + +if (!message) +{ +g_warning (Unable to call Inhibit()); +goto done; +} + + +if (!dbus_message_append_args (message, +DBUS_TYPE_STRING, what, +DBUS_TYPE_STRING, who, +DBUS_TYPE_STRING, why, +DBUS_TYPE_STRING, mode, +DBUS_TYPE_INVALID)) +{ +g_warning (Unable to call Inhibit()); +goto done; +} + + +reply = dbus_connection_send_with_reply_and_block (bus_connection, message, -1, error); +if (!reply) +{ +g_warning (Unable to inhibit systemd sleep: %s, error.message); +goto done; +} + +if (!dbus_message_get_args (reply, error, +DBUS_TYPE_UNIX_FD, fd, +DBUS_TYPE_INVALID)) +{ +g_warning (Inhibit() reply parsing failed: %s, error.message); +} + +done: + +if (message) +dbus_message_unref (message); +if (reply) +dbus_message_unref (reply); +dbus_error_free (error); + +return fd; +} + static void G_GNUC_NORETURN xfpm_start (DBusGConnection *bus, const gchar *client_id, gboolean dump) { +DBusGConnection *system_bus; XfpmManager *manager; GError *error = NULL; +gint inhibit_fd = -1; XFPM_DEBUG (Starting the power manager); manager = xfpm_manager_new (bus, client_id); - + +/* Don't allow systemd to handle power/suspend/hibernate buttons + * and lid-switch */ +system_bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, error); +if (system_bus) +inhibit_fd = xfpm_inhibit_sleep_systemd (system_bus); +else +{ +g_warning (Unable connect to system bus: %s, error-message); +g_clear_error (error); +} + if ( xfce_posix_signal_handler_init (error)) { xfce_posix_signal_handler_set_handler (SIGHUP, @@ -238,7 +318,10 @@ xfpm_start (DBusGConnection *bus, const gchar *client_id, gboolean dump) gtk_main (); g_object_unref (manager); - + +if (inhibit_fd = 0) +close (inhibit_fd); + exit (EXIT_SUCCESS); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Update to XFCE_PANEL_PLUGIN_REGISTER
Updating branch refs/heads/eric/bugzilla-patches to f1bf6f36e19bf38f149e22dc5a4f34f4b9e07eed (commit) from 9cae533cfd76113651330811c73f54691608aab4 (commit) commit f1bf6f36e19bf38f149e22dc5a4f34f4b9e07eed Author: Eric Koegel eric.koe...@gmail.com Date: Mon Jan 13 15:42:42 2014 +0300 Update to XFCE_PANEL_PLUGIN_REGISTER Updates from the per-4.8 panel registration method. Also updates the gtk about function for the new field and updates the makefile for the plugin. common/xfpm-common.c |4 +- panel-plugins/brightness/Makefile.am | 31 +++--- panel-plugins/brightness/brightness-button.c |7 +-- panel-plugins/brightness/brightness-plugin.c | 62 +--- .../xfce4-brightness-plugin.desktop.in.in |3 +- 5 files changed, 83 insertions(+), 24 deletions(-) diff --git a/common/xfpm-common.c b/common/xfpm-common.c index eca2ed5..ecfc6c9 100644 --- a/common/xfpm-common.c +++ b/common/xfpm-common.c @@ -151,10 +151,10 @@ xfpm_about (GtkWidget *widget, gpointer data) destroy-with-parent, TRUE, documenters, documenters, license, XFCE_LICENSE_GPL, -name, package, +program-name, package, translator-credits, _(translator-credits), version, PACKAGE_VERSION, -website, http://goodies.xfce.org;, +website, http://goodies.xfce.org/projects/applications/xfce4-power-manager;, NULL); } diff --git a/panel-plugins/brightness/Makefile.am b/panel-plugins/brightness/Makefile.am index 33836b0..a89ca8b 100644 --- a/panel-plugins/brightness/Makefile.am +++ b/panel-plugins/brightness/Makefile.am @@ -1,12 +1,24 @@ -plugindir = $(libdir)/xfce4/panel-plugins -plugin_PROGRAMS = xfce4-brightness-plugin +INCLUDES = \ + -I$(top_srcdir) \ + -DG_LOG_DOMAIN=\xfce4-brightness-plugin\ \ + -DPACKAGE_LOCALE_DIR=\$(localedir)\ \ + $(PLATFORM_CPPFLAGS) -xfce4_brightness_plugin_SOURCES = \ +# +# xfce4 brightness plugin +# +plugin_LTLIBRARIES = \ + libxfce4brightness.la + +plugindir = \ + $(libdir)/xfce4/panel/plugins + +libxfce4brightness_la_SOURCES =\ brightness-plugin.c \ brightness-button.c \ brightness-button.h -xfce4_brightness_plugin_CFLAGS = \ +libxfce4brightness_la_CFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -DLOCALEDIR=\$(localedir)\\ @@ -19,11 +31,14 @@ xfce4_brightness_plugin_CFLAGS =\ $(PLATFORM_CPPFLAGS)\ $(PLATFORM_CFLAGS) -xfce4_brightness_plugin_LDFLAGS = \ - -no-undefined \ - $(PLATFORM_LDFLAGS) +libxfce4brightness_la_LDFLAGS =\ + -avoid-version \ + -module \ + -no-undefined \ + -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \ + $(PLATFORM_LDFLAGS) -xfce4_brightness_plugin_LDADD =\ +libxfce4brightness_la_LIBADD = \ $(top_builddir)/common/libxfpmcommon.la \ $(LIBXFCE4PANEL_LIBS) \ $(LIBXFCE4UI_LIBS) \ diff --git a/panel-plugins/brightness/brightness-button.c b/panel-plugins/brightness/brightness-button.c index bd466c9..8c527bf 100644 --- a/panel-plugins/brightness/brightness-button.c +++ b/panel-plugins/brightness/brightness-button.c @@ -619,12 +619,9 @@ void brightness_button_show (BrightnessButton *button) GtkWidget *mi; g_return_if_fail (BRIGHTNESS_IS_BUTTON (button)); - -gtk_container_add (GTK_CONTAINER (button-priv-plugin), - GTK_WIDGET (button)); - + xfce_panel_plugin_add_action_widget (button-priv-plugin, GTK_WIDGET (button)); - + button-priv-image = gtk_image_new (); gtk_container_add (GTK_CONTAINER (button), button-priv-image); diff --git a/panel-plugins/brightness/brightness-plugin.c b/panel-plugins/brightness/brightness-plugin.c index f7e84d0..3df91dc 100644 --- a/panel-plugins/brightness/brightness-plugin.c +++ b/panel-plugins/brightness/brightness-plugin.c @@ -34,14 +34,60 @@ #include brightness-button.h -static void -register_brightness_plugin (XfcePanelPlugin *plugin) +/* plugin structure */ +typedef struct { -GtkWidget *button; - -button = brightness_button_new (plugin); - -brightness_button_show (BRIGHTNESS_BUTTON (button)); +XfcePanelPlugin *plugin; + +/* panel widgets */ +GtkWidget *ebox; +GtkWidget *brightness_button; } +BrightnessPlugin; + +/* prototypes */ +static void
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Add support for keyboard backlight control (Bug 10470)
Updating branch refs/heads/eric/bugzilla-patches to fbf8daf3709bd9fedbe251b6faaeebafcf02f830 (commit) from f1bf6f36e19bf38f149e22dc5a4f34f4b9e07eed (commit) commit fbf8daf3709bd9fedbe251b6faaeebafcf02f830 Author: Sonal Santan sonal.san...@gmail.com Date: Mon Jan 20 10:01:47 2014 +0300 Add support for keyboard backlight control (Bug 10470) I have enhanced xfce4-power-manager to support backlit keyboard brightness control through keyboard brightness keys. It uses org.freedesktop.UPower.KbdBacklight interface for increasing or decreasing the keyboard backlight brightness and binds with keys XF86XK_KbdBrightnessUp and XF86XK_KbdBrightnessDown. This feature is useful when the firmware does not handle the keyboard brightness control automatically. For example MacBook Pro leaves it to the OS to control the keyboard brightness through special keys. With this change, I can light up the keyboard on MacBook Pro and control its brightness through the special keys. I have also tested this on Lenovo X1 Carbon where the keyboard brightness is automatically handled by the firmware and this enhancement steps aside without interfering. src/Makefile.am |2 + src/xfpm-button.c|8 +- src/xfpm-enum-glib.h |2 + src/xfpm-enum.h | 16 +-- src/xfpm-kbd-backlight.c | 276 ++ src/xfpm-kbd-backlight.h | 55 + src/xfpm-manager.c | 45 +--- 7 files changed, 378 insertions(+), 26 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index e6e8ed3..316a823 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,8 @@ xfce4_power_manager_SOURCES = \ egg-idletime.h \ xfpm-backlight.c\ xfpm-backlight.h\ + xfpm-kbd-backlight.c\ + xfpm-kbd-backlight.h\ xfpm-dpms.c \ xfpm-dpms.h \ xfpm-button.c \ diff --git a/src/xfpm-button.c b/src/xfpm-button.c index 70c07a1..accf76d 100644 --- a/src/xfpm-button.c +++ b/src/xfpm-button.c @@ -208,12 +208,18 @@ xfpm_button_setup (XfpmButton *button) if ( xfpm_button_xevent_key (button, XF86XK_MonBrightnessUp, BUTTON_MON_BRIGHTNESS_UP) ) button-priv-mapped_buttons |= BRIGHTNESS_KEY_UP; - + if (xfpm_button_xevent_key (button, XF86XK_MonBrightnessDown, BUTTON_MON_BRIGHTNESS_DOWN) ) button-priv-mapped_buttons |= BRIGHTNESS_KEY_DOWN; xfpm_button_xevent_key (button, XF86XK_Battery, BUTTON_BATTERY); +if ( xfpm_button_xevent_key (button, XF86XK_KbdBrightnessUp, BUTTON_KBD_BRIGHTNESS_UP) ) + button-priv-mapped_buttons |= KBD_BRIGHTNESS_KEY_UP; + +if (xfpm_button_xevent_key (button, XF86XK_KbdBrightnessDown, BUTTON_KBD_BRIGHTNESS_DOWN) ) + button-priv-mapped_buttons |= KBD_BRIGHTNESS_KEY_DOWN; + gdk_window_add_filter (button-priv-window, xfpm_button_filter_x_events, button); } diff --git a/src/xfpm-enum-glib.h b/src/xfpm-enum-glib.h index b047eb4..5bb70fa 100644 --- a/src/xfpm-enum-glib.h +++ b/src/xfpm-enum-glib.h @@ -94,6 +94,8 @@ typedef enum BUTTON_MON_BRIGHTNESS_DOWN, BUTTON_LID_CLOSED, BUTTON_BATTERY, +BUTTON_KBD_BRIGHTNESS_UP, +BUTTON_KBD_BRIGHTNESS_DOWN, NUMBER_OF_BUTTONS } XfpmButtonKey; diff --git a/src/xfpm-enum.h b/src/xfpm-enum.h index 5a9f630..e254218 100644 --- a/src/xfpm-enum.h +++ b/src/xfpm-enum.h @@ -40,13 +40,15 @@ typedef enum typedef enum { -LID_KEY= (1 0), -BRIGHTNESS_KEY_UP = (1 1), -BRIGHTNESS_KEY_DOWN= (1 2), -SLEEP_KEY = (1 3), -HIBERNATE_KEY = (1 4), -POWER_KEY = (1 5) - +LID_KEY= (1 0), +BRIGHTNESS_KEY_UP = (1 1), +BRIGHTNESS_KEY_DOWN= (1 2), +SLEEP_KEY = (1 3), +HIBERNATE_KEY = (1 4), +POWER_KEY = (1 5), +KBD_BRIGHTNESS_KEY_UP = (1 6), +KBD_BRIGHTNESS_KEY_DOWN= (1 7) + } XfpmKeys; typedef enum diff --git a/src/xfpm-kbd-backlight.c b/src/xfpm-kbd-backlight.c new file mode 100644 index 000..c45283d --- /dev/null +++ b/src/xfpm-kbd-backlight.c @@ -0,0 +1,276 @@ +/* + * * Copyright (C) 2013 Sonal Santan sonal.san...@gmail.com + * + * Licensed under the GNU General Public License Version 2 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY;
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Fix empty systray icon in some panels on battery removal and addition
Updating branch refs/heads/eric/bugzilla-patches to 2382793018f1c3848929d019be706bf5dcacf039 (commit) from 79e77846329775ea4986ecb8c414642f61746b70 (commit) commit 2382793018f1c3848929d019be706bf5dcacf039 Author: Henry Gebhardt hsggebha...@googlemail.com Date: Wed Feb 29 14:14:33 2012 +0100 Fix empty systray icon in some panels on battery removal and addition Unreferencing a GtkStatusIcon is not enough to get rid of it entirely. This fixes these bugs: https://bugzilla.xfce.org/show_bug.cgi?id=7603 http://bugzilla.xfce.org/show_bug.cgi?id=8424 https://bugs.launchpad.net/ubuntu/+source/lxpanel/+bug/846878 https://bugzilla.redhat.com/show_bug.cgi?id=765726 Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfpm-battery.c |2 ++ src/xfpm-power.c |1 + 2 files changed, 3 insertions(+) diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index b3690d2..2e0e504 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -788,6 +788,8 @@ xfpm_battery_finalize (GObject *object) g_object_unref (battery-priv-notify); g_object_unref (battery-priv-button); +gtk_status_icon_set_visible(GTK_STATUS_ICON(battery), FALSE); + G_OBJECT_CLASS (xfpm_battery_parent_class)-finalize (object); } diff --git a/src/xfpm-power.c b/src/xfpm-power.c index a53753f..febac1d 100644 --- a/src/xfpm-power.c +++ b/src/xfpm-power.c @@ -1137,6 +1137,7 @@ xfpm_power_hide_adapter_icon (XfpmPower *power) if ( power-priv-adapter_icon ) { +gtk_status_icon_set_visible (power-priv-adapter_icon, FALSE); g_object_unref (power-priv-adapter_icon); power-priv-adapter_icon = NULL; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Display power percentage
Updating branch refs/heads/eric/bugzilla-patches to 4549373bdd56d42892cdda414b655e4a0b853a6c (commit) from 2382793018f1c3848929d019be706bf5dcacf039 (commit) commit 4549373bdd56d42892cdda414b655e4a0b853a6c Author: Pascal de Bruijn pmjdebru...@pcode.nl Date: Mon Dec 23 16:43:34 2013 +0100 Display power percentage This is particularly relevant for Logitech Unifying devices. My test device was a Logitech M185 wireless mouse, which has no power related properties except for percentage. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfpm-power-info.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/xfpm-power-info.c b/src/xfpm-power-info.c index e365da9..f0c9e50 100644 --- a/src/xfpm-power-info.c +++ b/src/xfpm-power-info.c @@ -465,6 +465,19 @@ xfpm_info_add_device_view (XfpmInfo *info, GHashTable *props, const gchar *objec g_free (str); } + /*Percentage*/ + str = xfpm_info_get_energy_property (props, Percentage, _(%)); + if ( str ) + { + gtk_list_store_append (list_store, iter); + gtk_list_store_set (list_store, iter, + XFPM_DEVICE_INFO_NAME, _(Percentage), + XFPM_DEVICE_INFO_VALUE, str, + -1); + i++; + g_free (str); + } + /*Vendor*/ value = g_hash_table_lookup (props, Vendor); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Fix status icon for devices other than battery and ups (Bug 8188)
Updating branch refs/heads/eric/bugzilla-patches to 9cae533cfd76113651330811c73f54691608aab4 (commit) from 4549373bdd56d42892cdda414b655e4a0b853a6c (commit) commit 9cae533cfd76113651330811c73f54691608aab4 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Jan 19 09:44:31 2014 +0300 Fix status icon for devices other than battery and ups (Bug 8188) xfpm_battery_refresh_icon incorrectly adds an additional dash to the icon prefix when the device is not a battery or a ups. Additionally, this patch correctly shows the icon when the device reports that it is charging. This patch only combines the patches submitted by Daniel Schubert and Dean Montgomery. src/xfpm-battery.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index 2e0e504..31576d6 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -320,20 +320,22 @@ xfpm_battery_refresh_icon (XfpmBattery *battery) { if ( !battery-priv-present || battery-priv-state == XFPM_DEVICE_STATE_EMPTY ) { - g_snprintf (icon_name, 128, %s-000, battery-priv-icon_prefix); + g_snprintf (icon_name, 128, %s000, battery-priv-icon_prefix); } else if ( battery-priv-state == XFPM_DEVICE_STATE_FULLY_CHARGED ) { - g_snprintf (icon_name, 128, %s-100, battery-priv-icon_prefix); + g_snprintf (icon_name, 128, %s100, battery-priv-icon_prefix); } - else if ( battery-priv-state == XFPM_DEVICE_STATE_DISCHARGING ) + else if ( battery-priv-state == XFPM_DEVICE_STATE_DISCHARGING || battery-priv-state == XFPM_DEVICE_STATE_CHARGING ) { - g_snprintf (icon_name, 128, %s-%s, + g_snprintf (icon_name, 128, %s%s, battery-priv-icon_prefix, xfpm_battery_get_icon_index (battery-priv-type, battery-priv-percentage)); } } +XFPM_DEBUG (Battery icon %s, icon_name); + gtk_status_icon_set_from_icon_name (GTK_STATUS_ICON (battery), icon_name); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Creating branch eric/bugzilla-patches
Updating branch refs/heads/eric/bugzilla-patches as new branch to 79e77846329775ea4986ecb8c414642f61746b70 (commit) Branches are created implicitly by pushing. This mail only exists to let you know that there was code pushed to refs/heads/eric/bugzilla-patches for the first time. Mails for the commits that lead to the creation of the branch will follow after this mail. ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-power-manager:eric/bugzilla-patches Add shutdown/reboot functionality for systemd (Bug 10167)
Updating branch refs/heads/eric/bugzilla-patches to 79e77846329775ea4986ecb8c414642f61746b70 (commit) from b0f1b3c72e7e36c9174c020a734febfb65e306ca (commit) commit 79e77846329775ea4986ecb8c414642f61746b70 Author: Andreas Müller schnitzelt...@googlemail.com Date: Mon Jan 13 13:20:15 2014 +0300 Add shutdown/reboot functionality for systemd (Bug 10167) based on the xfce4-session implementation [1] [1] http://git.xfce.org/xfce/xfce4-session/commit/?id=ae28aef315a7a6b90f1649ce6d1f30b842791cbf Guido Berhoerster assisted by allowing polkit support without needing systemd. Eric Koegel changed the xfpm-systemd.c code to use xfpm's internal polkit code rather than require an external dependancy so the checks can be done at runtime. src/Makefile.am|2 + src/xfpm-manager.c | 38 +++-- src/xfpm-power.c | 123 +++- src/xfpm-systemd.c | 229 src/xfpm-systemd.h | 62 ++ 5 files changed, 426 insertions(+), 28 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0435bed..e6e8ed3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,6 +20,8 @@ xfce4_power_manager_SOURCES = \ xfpm-disks.h\ xfpm-console-kit.c \ xfpm-console-kit.h \ + xfpm-systemd.c \ + xfpm-systemd.h \ egg-idletime.c \ egg-idletime.h \ xfpm-backlight.c\ diff --git a/src/xfpm-manager.c b/src/xfpm-manager.c index 853d78c..aff9431 100644 --- a/src/xfpm-manager.c +++ b/src/xfpm-manager.c @@ -57,6 +57,8 @@ #include xfpm-enum-glib.h #include xfpm-enum-types.h #include xfpm-dbus-monitor.h +#include xfpm-systemd.h + static void xfpm_manager_finalize (GObject *object); @@ -81,6 +83,7 @@ struct XfpmManagerPrivate XfpmXfconf *conf; XfpmBacklight *backlight; XfpmConsoleKit *console; +XfpmSystemd *systemd; XfpmDBusMonitor *monitor; XfpmDisks *disks; XfpmInhibit *inhibit; @@ -131,7 +134,10 @@ xfpm_manager_finalize (GObject *object) g_object_unref (manager-priv-button); g_object_unref (manager-priv-conf); g_object_unref (manager-priv-client); -g_object_unref (manager-priv-console); +if ( manager-priv-systemd != NULL ) +g_object_unref (manager-priv-systemd); +if ( manager-priv-console != NULL ) +g_object_unref (manager-priv-console); g_object_unref (manager-priv-monitor); g_object_unref (manager-priv-disks); g_object_unref (manager-priv-inhibit); @@ -201,7 +207,11 @@ static void xfpm_manager_shutdown (XfpmManager *manager) { GError *error = NULL; -xfpm_console_kit_shutdown (manager-priv-console, error ); + +if ( LOGIND_RUNNING () ) +xfpm_systemd_shutdown (manager-priv-systemd, error ); +else +xfpm_console_kit_shutdown (manager-priv-console, error ); if ( error ) { @@ -521,7 +531,14 @@ void xfpm_manager_start (XfpmManager *manager) manager-priv-power = xfpm_power_get (); manager-priv-button = xfpm_button_new (); manager-priv-conf = xfpm_xfconf_new (); -manager-priv-console = xfpm_console_kit_new (); +manager-priv-console = NULL; +manager-priv-systemd = NULL; + +if ( LOGIND_RUNNING () ) +manager-priv-systemd = xfpm_systemd_new (); +else +manager-priv-console = xfpm_console_kit_new (); + manager-priv-monitor = xfpm_dbus_monitor_new (); manager-priv-disks = xfpm_disks_new (); manager-priv-inhibit = xfpm_inhibit_new (); @@ -603,9 +620,18 @@ GHashTable *xfpm_manager_get_config (XfpmManager *manager) hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); -g_object_get (G_OBJECT (manager-priv-console), - can-shutdown, can_shutdown, - NULL); +if ( LOGIND_RUNNING () ) +{ +g_object_get (G_OBJECT (manager-priv-systemd), + can-shutdown, can_shutdown, + NULL); +} +else +{ +g_object_get (G_OBJECT (manager-priv-console), + can-shutdown, can_shutdown, + NULL); +} g_object_get (G_OBJECT (manager-priv-power), auth-suspend, auth_suspend, diff --git a/src/xfpm-power.c b/src/xfpm-power.c index d703f8e..a53753f 100644 --- a/src/xfpm-power.c +++ b/src/xfpm-power.c @@ -50,6 +50,8 @@ #include xfpm-debug.h #include xfpm-enum-types.h #include egg-idletime.h +#include xfpm-systemd.h + static void xfpm_power_finalize (GObject *object); @@ -75,6 +77,8 @@ struct XfpmPowerPrivate GHashTable *hash; + +XfpmSystemd *systemd; XfpmConsoleKit *console; XfpmInhibit
[Xfce4-commits] xfdesktop:master Fix some runtime warnings
Updating branch refs/heads/master to ae085d7a1b961870b70e0b22916d7cae67b992eb (commit) from 8e84a7f57a3d3c8dfe788d537e4b14ae16d22608 (commit) commit ae085d7a1b961870b70e0b22916d7cae67b992eb Author: Eric Koegel eric.koe...@gmail.com Date: Sun Jan 12 15:04:02 2014 +0300 Fix some runtime warnings This patch fixes it so that the file icon manager won't attempt to remove pending icons from the icon view as they won't be there yet. It also removes an icon migration function that shouldn't be needed anymore. src/xfdesktop-file-icon-manager.c | 102 - 1 file changed, 32 insertions(+), 70 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 857329a..a3201e6 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -502,62 +502,6 @@ xfdesktop_file_icon_manager_icon_view_manager_init(XfdesktopIconViewManagerIface iface-propose_drop_action = xfdesktop_file_icon_manager_propose_drop_action; } - - -/* FIXME: remove this before 4.4.0; leave it for now to migrate older beta -* installs from the old location */ -static void -__migrate_old_icon_positions(XfdesktopFileIconManager *fmanager) -{ -gchar relpath[PATH_MAX], *old_file; - -g_snprintf(relpath, PATH_MAX, xfce4/desktop/icons.screen%d-%dx%d.rc, - gdk_screen_get_number(fmanager-priv-gscreen), - gdk_screen_get_width(fmanager-priv-gscreen), - gdk_screen_get_height(fmanager-priv-gscreen)); - -old_file = xfce_resource_save_location(XFCE_RESOURCE_CACHE, relpath, FALSE); - -if(G_UNLIKELY(old_file) g_file_test(old_file, G_FILE_TEST_EXISTS)) { -gchar *new_file = xfce_resource_save_location(XFCE_RESOURCE_CONFIG, - relpath, FALSE); -if(G_LIKELY(new_file)) { -if(rename(old_file, new_file)) { -/* grumble, have to do this the hard way */ -gchar *contents = NULL; -gsize length = 0; -GError *error = NULL; - -if(g_file_get_contents(old_file, contents, length, error)) { -if(!g_file_set_contents(new_file, contents, length, -error)) -{ -g_critical(Unable to write to %s: %s, new_file, - error-message); -g_error_free(error); -} - -g_free(contents); -} else { -g_critical(Unable to read from %s: %s, old_file, - error-message); -g_error_free(error); -} -} -} else -g_critical(Unable to migrate icon position file to new location.); - -/* i debate removing the old file even if the migration failed, - * but i think this is the best way to avoid bug reports that - * aren't my problem. */ -unlink(old_file); - -g_free(new_file); -} - -g_free(old_file); -} - static gboolean xfdesktop_file_icon_manager_check_create_desktop_folder(GFile *folder) { @@ -2341,8 +2285,20 @@ xfdesktop_remove_icons_ht(gpointer key, gpointer value, gpointer user_data) { -xfdesktop_icon_view_remove_item(XFDESKTOP_ICON_VIEW(user_data), -XFDESKTOP_ICON(value)); +XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data); +XfdesktopIcon *icon = XFDESKTOP_ICON(value); +GList *item = NULL; + +/* find out if the icon was pending creation */ +if(fmanager-priv-pending_icons) +item = g_queue_find(fmanager-priv-pending_icons, icon); + +/* Remove the icon if it was in the icon view */ +if(item == NULL) { +xfdesktop_icon_view_remove_item(fmanager-priv-icon_view, +XFDESKTOP_ICON(value)); +} + return TRUE; } @@ -2377,7 +2333,7 @@ xfdesktop_file_icon_manager_refresh_icons(XfdesktopFileIconManager *fmanager) if(fmanager-priv-icons) { g_hash_table_foreach_remove(fmanager-priv-icons, (GHRFunc)xfdesktop_remove_icons_ht, -fmanager-priv-icon_view); +fmanager); } #if defined(DEBUG) DEBUG 0 @@ -2730,12 +2686,19 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator, GAsyncResult *result, gpointer user_data) { -XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data); +XfdesktopFileIconManager *fmanager; GError *error = NULL; GList *files, *l
[Xfce4-commits] xfdesktop:master Fix keyboard cursor movement in the icon view
Updating branch refs/heads/master to 0ab5c4185fa9d9a97c330267ad668107147c1fff (commit) from ae085d7a1b961870b70e0b22916d7cae67b992eb (commit) commit 0ab5c4185fa9d9a97c330267ad668107147c1fff Author: Eric Koegel eric.koe...@gmail.com Date: Mon Jan 13 10:43:50 2014 +0300 Fix keyboard cursor movement in the icon view src/xfdesktop-icon-view.c |3 --- 1 file changed, 3 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index ee39f82..fc5af70 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -2530,9 +2530,6 @@ xfdesktop_icon_view_real_move_cursor(XfdesktopIconView *icon_view, if(count == 0) return FALSE; -if(gtk_widget_has_focus(GTK_WIDGET(icon_view))) -return FALSE; - gtk_widget_grab_focus(GTK_WIDGET(icon_view)); gtk_get_current_event_state(modmask); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix icon labels in RTL languages (Bug 10604)
Updating branch refs/heads/master to 3cbad61da8ed5ef919d3e1ce38a483134eca8044 (commit) from be66a78f2a43de278411bd02bdde1cc0764bb03e (commit) commit 3cbad61da8ed5ef919d3e1ce38a483134eca8044 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Jan 6 16:01:50 2014 +0300 Fix icon labels in RTL languages (Bug 10604) src/xfdesktop-icon-view.c | 48 +++-- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 595d25e..ee39f82 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -267,7 +267,8 @@ static gboolean xfdesktop_icon_view_update_icon_extents(XfdesktopIconView *icon_ XfdesktopIcon *icon, GdkRectangle *pixbuf_extents, GdkRectangle *text_extents, -GdkRectangle *total_extents); +GdkRectangle *total_extents, +gint *rtl_offset); static void xfdesktop_icon_view_invalidate_icon(XfdesktopIconView *icon_view, XfdesktopIcon *icon, gboolean recalc_extents); @@ -2757,6 +2758,7 @@ xfdesktop_icon_view_invalidate_icon(XfdesktopIconView *icon_view, { GdkRectangle extents; gboolean invalidated_something = FALSE; +gint rtl_offset; g_return_if_fail(icon); @@ -2779,7 +2781,8 @@ xfdesktop_icon_view_invalidate_icon(XfdesktopIconView *icon_view, if(!xfdesktop_icon_view_update_icon_extents(icon_view, icon, pixbuf_extents, text_extents, -total_extents)) +total_extents, +rtl_offset)) { g_warning(Trying to invalidate icon, but can't recalculate extents); } else if(gtk_widget_get_realized(GTK_WIDGET(icon_view))) { @@ -2986,14 +2989,15 @@ xfdesktop_icon_view_update_icon_extents(XfdesktopIconView *icon_view, XfdesktopIcon *icon, GdkRectangle *pixbuf_extents, GdkRectangle *text_extents, -GdkRectangle *total_extents) +GdkRectangle *total_extents, +gint *rtl_offset) { GdkRectangle tmp_text; g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view) XFDESKTOP_IS_ICON(icon) pixbuf_extents text_extents - total_extents, FALSE); + total_extents rtl_offset, FALSE); if(!xfdesktop_icon_view_calculate_icon_pixbuf_area(icon_view, icon, pixbuf_extents) @@ -3005,14 +3009,17 @@ xfdesktop_icon_view_update_icon_extents(XfdesktopIconView *icon_view, pixbuf_extents-x += CELL_PADDING + ((CELL_SIZE - CELL_PADDING * 2) - pixbuf_extents-width) / 2; pixbuf_extents-y += CELL_PADDING; -if(!xfdesktop_icon_view_calculate_icon_text_area(icon_view, icon, - text_extents) - || !xfdesktop_icon_view_shift_area_to_cell(icon_view, icon, - text_extents)) -{ +if(!xfdesktop_icon_view_calculate_icon_text_area(icon_view, icon, text_extents)) return FALSE; -} -text_extents-x += (CELL_SIZE - text_extents-width) / 2; + +/* text_extents-x right now includes the padding needed for rtl languages + * to display properly if it's set */ +*rtl_offset = text_extents-x; + +if(!xfdesktop_icon_view_shift_area_to_cell(icon_view, icon, text_extents)) +return FALSE; + +text_extents-x += (CELL_SIZE - text_extents-width) / 2 - *rtl_offset; text_extents-y += ICON_SIZE + SPACING + LABEL_RADIUS + CELL_PADDING; tmp_text = *text_extents; @@ -3043,11 +3050,11 @@ xfdesktop_icon_view_draw_image(cairo_t *cr, GdkPixbuf *pix, GdkRectangle *rect) static void xfdesktop_icon_view_draw_text(cairo_t *cr, PangoLayout *playout, - gint x, gint y, GdkColor *color) + gint x, gint y, gint rtl_offset, GdkColor *color) { cairo_save(cr); -cairo_move_to(cr, x, y); +cairo_move_to(cr, x - rtl_offset, y); gdk_cairo_set_source_color(cr, color); pango_cairo_show_layout(cr, playout); @@ -3061,7 +3068,7
[Xfce4-commits] xfdesktop:master Ensure a quit signal causes xfdesktop to shutdown
Updating branch refs/heads/master to cfe5a0ad88b84a23a4cd6d18a25635ec84cbaf68 (commit) from 3cbad61da8ed5ef919d3e1ce38a483134eca8044 (commit) commit cfe5a0ad88b84a23a4cd6d18a25635ec84cbaf68 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Jan 8 20:36:16 2014 +0300 Ensure a quit signal causes xfdesktop to shutdown src/xfdesktop-application.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index 91d25e6..5756df0 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -252,12 +252,8 @@ session_die(gpointer user_data) TRACE(entering); -/* If we somehow got here after the app has been released we don't need - * to do anything */ -if(user_data == NULL || !XFDESKTOP_IS_APPLICATION(user_data)) -return; - -app = XFDESKTOP_APPLICATION(user_data); +/* Ensure we always have a valid reference so we can quit xfdesktop */ +app = xfdesktop_application_get(); /* Cancel the wait for wm check if it's still running */ g_cancellable_cancel(app-cancel); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Use get_folder_actions for clicks on the desktop itself
Updating branch refs/heads/master to c4782e358f100f33c665e67d47425f77c9655ec4 (commit) from 1028f607551254cca5db4951e9e52d4bb4d09c6d (commit) commit c4782e358f100f33c665e67d47425f77c9655ec4 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Jan 5 21:47:39 2014 +0300 Use get_folder_actions for clicks on the desktop itself Call thunarx_menu_provider_get_folder_actions when the menu is popped up and no icons are selected. This prevents showing some thunar actions that make little sense in that context. src/xfdesktop-file-icon-manager.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 1b424d9..857329a 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -1620,14 +1620,25 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop, GList *menu_actions = NULL; ThunarxMenuProvider *provider; -/* thunar file specific actions (allows them to operate on folders - * as well) */ -for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { -provider = THUNARX_MENU_PROVIDER(l-data); -menu_actions = g_list_concat(menu_actions, - thunarx_menu_provider_get_file_actions(provider, - toplevel, - selected)); +if(selected-data == fmanager-priv-desktop_icon) { +/* click on the desktop itself, only show folder actions */ +for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { +provider = THUNARX_MENU_PROVIDER(l-data); +menu_actions = g_list_concat(menu_actions, + thunarx_menu_provider_get_folder_actions(provider, + toplevel, + THUNARX_FILE_INFO(file_icon))); +} +} else { +/* thunar file specific actions (allows them to operate on folders + * that are on the desktop as well) */ +for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { +provider = THUNARX_MENU_PROVIDER(l-data); +menu_actions = g_list_concat(menu_actions, + thunarx_menu_provider_get_file_actions(provider, + toplevel, + selected)); +} } if(menu_actions) { ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Only use thunarx_menu_provider_get_file_actions (Bug 10492)
Updating branch refs/heads/master to b13d47e52d3755f9e9c424339063370a8ca7234b (commit) from ff207e4a68c3308083c3fc8dab48700672d9f061 (commit) commit b13d47e52d3755f9e9c424339063370a8ca7234b Author: Eric Koegel eric.koe...@gmail.com Date: Sun Dec 29 22:39:07 2013 +0300 Only use thunarx_menu_provider_get_file_actions (Bug 10492) Using thunarx_menu_provider_get_file_actions on both folders and files allows all the options to display. Using both files_actions and folder_actions would cause some duplicate entires. This allows the thunar-archive-plugin to provide the 'create archive' menu option for folders on the desktop. src/xfdesktop-file-icon-manager.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index b263c01..1b424d9 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -1620,24 +1620,16 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop, GList *menu_actions = NULL; ThunarxMenuProvider *provider; -if(g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) { -for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { -provider = THUNARX_MENU_PROVIDER(l-data); -menu_actions = g_list_concat(menu_actions, - thunarx_menu_provider_get_folder_actions(provider, - toplevel, - THUNARX_FILE_INFO(file_icon))); -} -} else { -for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { -provider = THUNARX_MENU_PROVIDER(l-data); -menu_actions = g_list_concat(menu_actions, - thunarx_menu_provider_get_file_actions(provider, - toplevel, - selected)); -} +/* thunar file specific actions (allows them to operate on folders + * as well) */ +for(l = fmanager-priv-thunarx_menu_providers; l; l = l-next) { +provider = THUNARX_MENU_PROVIDER(l-data); +menu_actions = g_list_concat(menu_actions, + thunarx_menu_provider_get_file_actions(provider, + toplevel, + selected)); } - + if(menu_actions) { xfdesktop_menu_shell_append_action_list(GTK_MENU_SHELL(menu), menu_actions); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Updates for release.
Updating branch refs/heads/master to 9e7c92a9701efa4c262c26bb48b427651e47c9c1 (commit) from a893ba38b656d6a76ff2c93050d19526419641a2 (commit) commit 9e7c92a9701efa4c262c26bb48b427651e47c9c1 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Dec 22 15:22:27 2013 +0300 Updates for release. NEWS| 57 +++ configure.ac.in |4 ++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 4dbfc8f..fa4481a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,60 @@ +4.11.2 +== +[Please note that this is a development release.] + +Third development release of xfdesktop targeting for Xfce 4.12. +Please report all problems at bugzilla.xfce.org. + +* Xfdesktop-settings: + - Add xfconf property to toggle the display of the add/remove +workspace menu items in the middle click menu (Bug 4278, 7337) + - Add an info bar to xfdesktop-settings so it is clearer on how +to customize additional workspaces and monitors (Bug 10460) + - Keyboard navigation has been improved in xfdesktop-settings + +* Port Xfdesktop to the GApplication API: + - Xfdesktop now uses the GApplication API to handle process +uniqueness, message passing, and life cycle management. + +* Improve how Xfdesktop transitions from the login manager to + the initial wallpaper display; all bugs were reported and + resolved by Alistair Buxton: +- Don't set the root pixmap until it's been drawn +- Don't show the window until the background is ready. +- Don't set ESETROOT. + +* Miscellaneous fixes: +- Scale down over-sized icons in menus so they have a uniform + appearance (Bugs 10545, 10461) +- Move max-template-files xfconf property +- Remove old GLIB/GTK macro checks +- Update man page +- Wait for the window manager to prevent issues where the + wallpaper and icons won't show up on additional screens + during startup (Bug 7769) +- Fix icon renames causing duplicate icons +- Fix icons for .desktop files with absolute paths +- Don't show hidden or backup files on the desktop (Bug 9001) +- Fix a couple warning messages that happen when xfdesktop is + shutdown while it's still starting up +- Improve how backdrops are chosen + +* Translation updates: + Arabic (ar), Basque (eu), Bulgarian (bg), Catalan (ca), + Chinese (China) (zh_CN), Chinese (Hong Kong) (zh_HK), + Chinese (Taiwan) (zh_TW), Croatian (hr), Czech (cs), + Danish (da), Dutch (Flemish) (nl), English (Australia) (en_AU), + English (United Kingdom) (en_GB), Estonian (et), French (fr), + Galician (gl), German (de), Greek (el), Hebrew (he), + Hungarian (hu), Icelandic (is), Indonesian (id), Italian (it), + Japanese (ja), Kazakh (kk), Korean (ko), Lithuanian (lt), + Malay (ms), Norwegian Bokmål (nb), Norwegian Nynorsk (nn), + Occitan (post 1500) (oc), Persian (Iran) (fa_IR), Polish (pl), + Portuguese (pt), Portuguese (Brazilian) (pt_BR), Romanian (ro), + Russian (ru), Serbian (sr), Slovak (sk), Slovenian (sl), + Spanish (Castilian) (es), Swedish (sv), Thai (th), + Turkish (tr), Ukrainian (uk), Uyghur (ug), and Uzbek (uz). + 4.11.1 == - Wrong g_return_if_fail macro used diff --git a/configure.ac.in b/configure.ac.in index ca310f2..41e4e3d 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -6,10 +6,10 @@ dnl dnl version info m4_define([xfdesktop_version_major], [4]) m4_define([xfdesktop_version_minor], [11]) -m4_define([xfdesktop_version_micro], [1]) +m4_define([xfdesktop_version_micro], [2]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[git]) +m4_define([xfdesktop_version_tag],[]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop|xfdesktop-4.11.2 Creating annotated tag xfdesktop-4.11.2
Updating annotated tag refs/tags/xfdesktop-4.11.2 as new annotated tag to 4afbee8262d3fd67d052220e972207f6baf4f464 (tag) succeeds xfdesktop-4.11.1-137-ga893ba3 tagged by Eric Koegel eric.koe...@gmail.com on 2013-12-22 13:23 +0100 Eric Koegel (1): Updates for release. ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Post release tag bump.
Updating branch refs/heads/master to b275ed97f978c8fda037c185efbdd01d56738b48 (commit) from 9e7c92a9701efa4c262c26bb48b427651e47c9c1 (commit) commit b275ed97f978c8fda037c185efbdd01d56738b48 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Dec 22 15:28:31 2013 +0300 Post release tag bump. configure.ac.in |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac.in b/configure.ac.in index 41e4e3d..4043d9f 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -9,7 +9,7 @@ m4_define([xfdesktop_version_minor], [11]) m4_define([xfdesktop_version_micro], [2]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[]) +m4_define([xfdesktop_version_tag],[git]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Scale down oversize icons in menus (Bugs 10545, 10461)
Updating branch refs/heads/master to 596ac7b07939b3b93c6253b2db704a91e68e75d0 (commit) from 37baff27944ba6282e420069e0993f08953ff482 (commit) commit 596ac7b07939b3b93c6253b2db704a91e68e75d0 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Dec 15 12:18:01 2013 +0300 Scale down oversize icons in menus (Bugs 10545, 10461) Use exo_gdk_pixbuf_scale_down to ensure the icons in the menu don't exceed the selected icon size. src/xfdesktop-app-menu-item.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c index 8485f4c..ca19499 100644 --- a/src/xfdesktop-app-menu-item.c +++ b/src/xfdesktop-app-menu-item.c @@ -31,6 +31,7 @@ #include libxfce4util/libxfce4util.h #include libxfce4ui/libxfce4ui.h +#include exo/exo.h #include xfdesktop-app-menu-item.h @@ -212,6 +213,11 @@ xfdesktop_app_menu_item_set_icon(XfdesktopAppMenuItem *app_menu_item) /* Turn the pixbuf into a gtk_image */ if(G_LIKELY(pixbuf)) { +/* scale the pixbuf down if it needs it */ +GdkPixbuf *tmp = exo_gdk_pixbuf_scale_down(pixbuf, TRUE, w, h); +g_object_unref(pixbuf); +pixbuf = tmp; + image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Remove old GLIB/GTK macro checks
Updating branch refs/heads/master to 1a91076400b8f56126e654ccbd9751acc24974ed (commit) from f12aa431c11f4aac2e9805f68e2f1d5b5424e079 (commit) commit 1a91076400b8f56126e654ccbd9751acc24974ed Author: Eric Koegel eric.koe...@gmail.com Date: Sat Dec 14 21:35:35 2013 +0300 Remove old GLIB/GTK macro checks Remove old GLIB/GTK workarounds that were needed in the past. Also GSEAL a context action and switch from GtkObject to GtkWidget as GtkObject will be gone in the future. src/windowlist.c |2 +- src/xfdesktop-app-menu-item.c | 19 +-- src/xfdesktop-clipboard-manager.c |4 ++-- src/xfdesktop-file-icon-manager.c |5 + src/xfdesktop-icon-view.c |2 +- src/xfdesktop-regular-file-icon.c |5 + src/xfdesktop-special-file-icon.c |5 + src/xfdesktop-volume-icon.c |6 +- 8 files changed, 9 insertions(+), 39 deletions(-) diff --git a/src/windowlist.c b/src/windowlist.c index fd04573..09292e1 100644 --- a/src/windowlist.c +++ b/src/windowlist.c @@ -123,7 +123,7 @@ window_destroyed_cb(gpointer data, GObject *where_the_object_was) } static void -mi_destroyed_cb(GtkObject *object, gpointer user_data) +mi_destroyed_cb(GtkWidget *object, gpointer user_data) { g_object_weak_unref(G_OBJECT(user_data), (GWeakNotify)window_destroyed_cb, object); diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c index f565c21..8485f4c 100644 --- a/src/xfdesktop-app-menu-item.c +++ b/src/xfdesktop-app-menu-item.c @@ -45,7 +45,7 @@ struct _XfdesktopAppMenuItem typedef struct _XfdesktopAppMenuItemClass { - GtkImageMenuItemClass parent; +GtkImageMenuItemClass parent; } XfdesktopAppMenuItemClass; enum @@ -228,9 +228,6 @@ static void xfdesktop_app_menu_item_changed(XfdesktopAppMenuItem *app_menu_item) { const gchar *label; -#if !GTK_CHECK_VERSION (2, 16, 0) -GtkWidget *child; -#endif g_return_if_fail(XFCE_IS_APP_MENU_ITEM(app_menu_item)); g_return_if_fail(GARCON_IS_MENU_ITEM(app_menu_item-item)); @@ -242,21 +239,7 @@ xfdesktop_app_menu_item_changed(XfdesktopAppMenuItem *app_menu_item) if (G_UNLIKELY (label == NULL)) label = ; -#if GTK_CHECK_VERSION(2, 16, 0) gtk_menu_item_set_label(GTK_MENU_ITEM(app_menu_item), label); -#else -child = gtk_bin_get_child(GTK_BIN (app_menu_item)); -if (child == NULL) { -child = gtk_accel_label_new(label); -gtk_container_add(GTK_CONTAINER(app_menu_item), child); -gtk_misc_set_alignment(GTK_MISC(child), 0.0, 0.5); -gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(child), GTK_WIDGET(app_menu_item)); -gtk_widget_show(child); -} else { -g_return_if_fail(GTK_IS_LABEL(child)); -gtk_label_set_text(GTK_LABEL(child), label); -} -#endif } static void diff --git a/src/xfdesktop-clipboard-manager.c b/src/xfdesktop-clipboard-manager.c index 75a07cf..a02dacc 100644 --- a/src/xfdesktop-clipboard-manager.c +++ b/src/xfdesktop-clipboard-manager.c @@ -78,11 +78,11 @@ static void xfdesktop_clipboard_manager_file_destroyed (XfdesktopClipboardMan static void xfdesktop_clipboard_manager_owner_changed (GtkClipboard *clipboard, GdkEventOwnerChange *event, XfdesktopClipboardManager *manager); -#if 0 + static void xfdesktop_clipboard_manager_contents_received (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer user_data); -#endif + static void xfdesktop_clipboard_manager_targets_received (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer user_data); diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 239d064..f473701 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2739,11 +2739,8 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator, if(!files) { if(error) { GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager-priv-icon_view)); -#if GTK_CHECK_VERSION (2, 18, 0) + xfce_message_dialog(gtk_widget_is_toplevel(toplevel) ? GTK_WINDOW(toplevel) : NULL, -#else -xfce_message_dialog(GTK_WIDGET_TOPLEVEL(toplevel) ? GTK_WINDOW(toplevel) : NULL, -#endif _(Load Error), GTK_STOCK_DIALOG_WARNING, _(Failed to load the desktop
[Xfce4-commits] xfdesktop:master Add a settings option for the add/remove workspace property
Updating branch refs/heads/master to fb2bee20a297458adb1d00a4ea878a36d290b57a (commit) from e2e0d0feee28148e6786245b6ee47a64c9d1cc46 (commit) commit fb2bee20a297458adb1d00a4ea878a36d290b57a Author: Eric Koegel eric.koe...@gmail.com Date: Sat Dec 14 22:04:30 2013 +0300 Add a settings option for the add/remove workspace property settings/main.c |6 ++ settings/xfdesktop-settings-ui.glade | 13 + 2 files changed, 19 insertions(+) diff --git a/settings/main.c b/settings/main.c index d64bf81..dec5ea4 100644 --- a/settings/main.c +++ b/settings/main.c @@ -70,6 +70,7 @@ #define WINLIST_SHOW_STICKY_WIN_ONCE_PROP /windowlist-menu/show-sticky-once #define WINLIST_SHOW_WS_NAMES_PROP /windowlist-menu/show-workspace-names #define WINLIST_SHOW_WS_SUBMENUS_PROP/windowlist-menu/show-submenus +#define WINLIST_SHOW_ADD_REMOVE_WORKSPACES_PROP /windowlist-menu/show-add-remove-workspaces #define DESKTOP_ICONS_STYLE_PROP /desktop-icons/style #define DESKTOP_ICONS_ICON_SIZE_PROP /desktop-icons/icon-size @@ -1880,6 +1881,11 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, gtk_builder_get_object(main_gxml, chk_show_winlist_sticky_once), active); +xfconf_g_property_bind(channel, WINLIST_SHOW_ADD_REMOVE_WORKSPACES_PROP, + G_TYPE_BOOLEAN, + gtk_builder_get_object(main_gxml, chk_show_app_remove_workspaces), + active); + w = GTK_WIDGET(gtk_builder_get_object(main_gxml, chk_show_winlist_ws_names)); xfconf_g_property_bind(channel, WINLIST_SHOW_WS_NAMES_PROP, G_TYPE_BOOLEAN, G_OBJECT(w), active); diff --git a/settings/xfdesktop-settings-ui.glade b/settings/xfdesktop-settings-ui.glade index 16f7ae8..9630a31 100644 --- a/settings/xfdesktop-settings-ui.glade +++ b/settings/xfdesktop-settings-ui.glade @@ -488,6 +488,19 @@ property name=position4/property /packing /child +child + object class=GtkCheckButton id=chk_show_app_remove_workspaces +property name=visibleTrue/property +property name=can_focusTrue/property +property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property +property name=label translatable=yesShow a_dd and remove workspace options in list/property +property name=use_underlineTrue/property +property name=draw_indicatorTrue/property + /object + packing +property name=position5/property + /packing +/child /object /child /object ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Move max-template-files xfconf property
Updating branch refs/heads/master to e2e0d0feee28148e6786245b6ee47a64c9d1cc46 (commit) from 1a91076400b8f56126e654ccbd9751acc24974ed (commit) commit e2e0d0feee28148e6786245b6ee47a64c9d1cc46 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Dec 14 21:52:38 2013 +0300 Move max-template-files xfconf property Put the max-template-files xfconf property under the desktop-menu where it belongs. common/xfdesktop-common.h |3 ++- doc/README.xfconf |4 ++-- src/xfdesktop-file-icon-manager.c |2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 78f543b..f73606a 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -61,7 +61,8 @@ #define DESKTOP_ICONS_SHOW_TRASH /desktop-icons/file-icons/show-trash #define DESKTOP_ICONS_SHOW_FILESYSTEM /desktop-icons/file-icons/show-filesystem #define DESKTOP_ICONS_SHOW_REMOVABLE /desktop-icons/file-icons/show-removable -#define DESKTOP_ICONS_MAX_TEMPLATE_FILES /desktop-icons/file-icons/max-template-files + +#define DESKTOP_MENU_MAX_TEMPLATE_FILES /desktop-menu/max-template-files /** * File information namespaces queried for #GFileInfo objects. diff --git a/doc/README.xfconf b/doc/README.xfconf index a762688..80f0ed8 100644 --- a/doc/README.xfconf +++ b/doc/README.xfconf @@ -32,10 +32,11 @@ the same monitor is plugged in again those settings apply to it. show-sticky-once bool show-submenus bool show-add-remove-workspaces bool -/windowlist +/windowlist-menu desktop-menu show bool show-icons bool +max-template-files int /desktop-menu desktop-icons style int @@ -54,6 +55,5 @@ the same monitor is plugged in again those settings apply to it. show-device-removable bool show-network-removable bool show-unknown-removable bool -max-template-files int /file-icons /desktop-icons diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index f473701..b263c01 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -3687,7 +3687,7 @@ xfdesktop_file_icon_manager_new(GFile *folder, G_OBJECT(fmanager), show-unknown-volume); xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, G_OBJECT(fmanager), show-thumbnails); -xfconf_g_property_bind(channel, DESKTOP_ICONS_MAX_TEMPLATE_FILES, G_TYPE_INT, +xfconf_g_property_bind(channel, DESKTOP_MENU_MAX_TEMPLATE_FILES, G_TYPE_INT, G_OBJECT(fmanager), max-templates); return XFDESKTOP_ICON_VIEW_MANAGER(fmanager); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Update man page
Updating branch refs/heads/master to a83d43d32562c76754cbba3b5cbcabcd656c0081 (commit) from ce72d74bc4d339336e2e856097d9ef82fb5a4f59 (commit) commit a83d43d32562c76754cbba3b5cbcabcd656c0081 Author: Eric Koegel eric.koe...@gmail.com Date: Thu Dec 12 11:35:56 2013 +0300 Update man page xfdesktop.1 | 45 + 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/xfdesktop.1 b/xfdesktop.1 index e8638b2..e73ea50 100644 --- a/xfdesktop.1 +++ b/xfdesktop.1 @@ -1,4 +1,4 @@ -.TH XFDESKTOP 1 Version 4.11.0 29 September 2013 +.TH XFDESKTOP 1 December 2013 .SH NAME xfdesktop \- The Xfce 4 Desktop Environment's desktop manager @@ -18,24 +18,49 @@ icons on the desktop. Only one instance of xfdesktop can be running at a time, and should be started by running \fBxfdesktop\fP without any arguments. .SH OPTIONS + +.SS HELP OPTIONS: +.TP +.B \-h, --help +Show help options +.TP +.B \--help-all +Show all help options +.TP +.B \--help-gtk +Show GTK+ Options +.TP +.B \--help-sm-client +Show session management options + +.SS APPLICATION OPTIONS: .TP -.B \--reload +.B \-V, --version +Display version information +.TP +.B \-R, --reload Causes an already-running instance of \fBxfdesktop\fP to reload all its settings, including loading a new random backdrop if using a backdrop list. .TP -.B \--menu +.B \-M, --menu Causes an already-running instance of \fBxfdesktop\fP to pop up the applications menu at the current position of the mouse cursor. .TP -.B \--windowlist +.B \-W, --windowlist Causes an already-running instance of \fBxfdesktop\fP to pop up the window list menu at the current position of the mouse cursor. .TP -.B \--arrange +.B \-A, --arrange Automatically arrange all the icons on the desktop .TP -.B \--quit +.B \-D, --disable-wm-check +Do not wait for a window manager on startup +.TP +.B \-Q, --quit Cause \fBxfdesktop\fP to quit +.TP +.B \--display=[DISPLAY] +X display to use .SH ENVIRONMENT \fBxfdesktop\fP's behavior is affected by the following environment variables. @@ -61,9 +86,12 @@ If this environment variable is not present, it defaults to .SH BUGS Please report any bugs to .IR http://bugzilla.xfce.org/ . +.br Development discussion should be conducted on the .IR xfce4-...@xfce.org -mailing list. Usage-related questions should be directed to the +mailing list. +.br +Usage-related questions should be directed to the .IR x...@xfce.org mailing list. @@ -72,7 +100,8 @@ mailing list. .SH AUTHOR Jasper Huijsmans huysm...@users.sourceforge.net, Benedikt Meurer -be...@xfce.org, and Brian Tarricone bj...@cornell.edu. +be...@xfce.org, Brian Tarricone bj...@cornell.edu, and Eric +Koegel e...@xfce.org. This manual page was originally written by Brian Tarricone .br ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Add xfconf property for add/remove workspace (Bug 4278, 7337)
Updating branch refs/heads/master to f12aa431c11f4aac2e9805f68e2f1d5b5424e079 (commit) from a83d43d32562c76754cbba3b5cbcabcd656c0081 (commit) commit f12aa431c11f4aac2e9805f68e2f1d5b5424e079 Author: Eric Koegel eric.koe...@gmail.com Date: Thu Dec 12 17:48:55 2013 +0300 Add xfconf property for add/remove workspace (Bug 4278, 7337) An xfconf property /windowlist-menu/show-add-remove-workspaces was added to allow the removal of the Add/Remove workspace buttons on the windowlist menu. This will allow administrators to remove those options when locking down xfconf properties for kiosk setups. Also this patch updates the README.xfconf file with all the recent xfconf property changes. It also revises the README.kiosk file since xfdesktop relies on xfconf to lock properties rather than the kioskrc file. doc/README.kiosk | 58 +- doc/README.xfconf | 39 ++-- src/windowlist.c | 73 ++--- 3 files changed, 72 insertions(+), 98 deletions(-) diff --git a/doc/README.kiosk b/doc/README.kiosk index b0a175b..51728ab 100644 --- a/doc/README.kiosk +++ b/doc/README.kiosk @@ -1,52 +1,6 @@ -Xfdesktop supports a 'kiosk mode' in which you can restrict the actions users -are allowed to take. You can do this by creating a file called -'xfdesktop.kioskrc' in $sysconfdir/xdg/xfce4/kiosk/ (usually -/etc/xdg/xfce4/kiosk/). A sample file might look like this: - begin xfdesktop.kioskrc --- -UserMenu=%wheel -CustomizeBackdrop=ALL -CustomizeDesktopMenu=%wheel -CustomizeWindowlist=NONE -CustomizeDesktopIcons=brian end xfdesktop.kioskrc --- - -Additionally, the above can be added to $sysconfdir/xdg/xfce4/kiosk/kioskrc -if you put it in a section called '[xfdesktop]', like so: - begin kioskrc --- -[xfdesktop] -UserMenu=%wheel -CustomizeBackdrop=ALL -CustomizeDesktopMenu=%wheel -CustomizeWindowlist=NONE -CustomizeDesktopIcons=brian end kioskrc --- - -Entries in $sysconfdir/xdg/xfce4/kiosk/kioskrc will override any entries in -$sysconfdir/xdg/xfce4/kiosk/xfdesktop.kioskrc. - -Each entry can have a user name, a group name (prefixed with '%'), or one of -the two special values 'ALL' or 'NONE'. Lists of names should be -comma-separated. - -Here's an explanation of the keys: - -UserMenu: Whether or not to allow user modifications to the desktop menu. If - not, xfdesktop will ignore the menu.xml file in - ~/.config/xfce4/desktop/ and use the system menu in - $sysconfdir/xdg/xfce4/desktop/menu.xml. - -CustomizeBackdrop: Whether or not to allow user modifications to the desktop - backdrop. If not, the Backdrop settings panel will be greyed out. - -CustomizeDesktopMenu: Whether or not to allow user modifications to the desktop - menu. This includes showing or hiding application icons, as well - as showing or hiding the menu itself. - -CustomizeWindowlist: Whether or not to allow user modifications to the window - list. This includes showing or hiding window icons, as well as - showing or hiding the menu itself. - -CustomizeDesktopIcons: Whether or not to allow the user to enable or disable - the display of desktop icons, or change their style. +Any xfconf property or channel can be locked down to prevent +specific users or groups from making changes. See the +README.xfconf for the list of properties xfdesktop supports. +Additional kiosk information is available at: +http://docs.xfce.org/xfce/xfconf/start +http://git.xfce.org/xfce/xfconf/tree/docs/spec/perchannel-xml.txt diff --git a/doc/README.xfconf b/doc/README.xfconf index 74bf96e..a762688 100644 --- a/doc/README.xfconf +++ b/doc/README.xfconf @@ -3,46 +3,57 @@ hierarchical configuration system. The channel name that xfdesktop uses is 'xfce4-desktop'. Property names below should be referred to with each component separated by a slash ('/') character. The data type of each property is listd after the name. +The monitor settings are referred to by name where possible so that when +the same monitor is plugged in again those settings apply to it. -manage-desktop - show-warning-off bool - show-warning-on bool -/manage-desktop backdrop + single-workspace-mode bool + single-workspace-number int screen0 -xinerama-stretch bool monitor0 - brightness int - color1 array:uint16,uint16,uint16 - color2 array:uint16,uint16,uint16 - color-style int - image-path string - image-style int - image-show bool + workspace0 +backdrop-cycle-enable bool +backdrop-cycle-period int +backdrop-cycle-random-order bool +backdrop-cycle-timer int +color1 array:uint16,uint16,uint16 +color2 array:uint16,uint16,uint16 +color-style int +image-style int +last-image string + /workspace0 /monitor0
[Xfce4-commits] xfdesktop:master Don't set the root pixmap until it's been drawn
Updating branch refs/heads/master to a450d7b213754f8d9979b5324f315201a2929c98 (commit) from c9eaa4e01933e21a02ee2a4bf6ea4726cf70b755 (commit) commit a450d7b213754f8d9979b5324f315201a2929c98 Author: Alistair Buxton a.j.bux...@gmail.com Date: Thu Nov 28 03:18:30 2013 +0300 Don't set the root pixmap until it's been drawn Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfce-desktop.c |2 -- 1 file changed, 2 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 27df359..ad8f533 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -349,8 +349,6 @@ create_bg_pixmap(GdkScreen *gscreen, gpointer user_data) if(!GDK_IS_PIXMAP(desktop-priv-bg_pixmap)) return NULL; -set_real_root_window_pixmap(desktop-priv-gscreen, -desktop-priv-bg_pixmap); gdk_window_set_back_pixmap(gtk_widget_get_window(GTK_WIDGET(desktop)), desktop-priv-bg_pixmap, FALSE); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Don't set ESETROOT.
Updating branch refs/heads/master to f4c2a90d89961e99d422cb59bb58322195976414 (commit) from a450d7b213754f8d9979b5324f315201a2929c98 (commit) commit f4c2a90d89961e99d422cb59bb58322195976414 Author: Alistair Buxton a.j.bux...@gmail.com Date: Thu Nov 28 00:29:26 2013 + Don't set ESETROOT. This atom is used to inform other processes that the background was set by a RetainPermanent client, which should be killed if the background changes. Since xfdesktop is not RetainPermanent and should not get killed, don't set this. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfce-desktop.c |5 - 1 file changed, 5 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index ad8f533..7ae3e0c 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -304,11 +304,6 @@ set_real_root_window_pixmap(GdkScreen *gscreen, gdk_atom_intern(_XROOTPMAP_ID, FALSE), gdk_atom_intern(PIXMAP, FALSE), 32, GDK_PROP_MODE_REPLACE, (guchar *)xid, 1); -/* set this other property because someone might need it sometime. */ -gdk_property_change(groot, -gdk_atom_intern(ESETROOT_PMAP_ID, FALSE), -gdk_atom_intern(PIXMAP, FALSE), 32, -GDK_PROP_MODE_REPLACE, (guchar *)xid, 1); /* and set the root window's BG pixmap, because aterm is somewhat lame. */ gdk_window_set_back_pixmap(groot, pmap, FALSE); /* there really should be a standard for this crap... */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Don't show the window until the background is ready.
Updating branch refs/heads/master to e47515567cecc02650e18ac1826fccc94da80857 (commit) from fc514be368a460b0946097236f58279dc7d6 (commit) commit e47515567cecc02650e18ac1826fccc94da80857 Author: Alistair Buxton a.j.bux...@gmail.com Date: Mon Nov 25 22:31:12 2013 + Don't show the window until the background is ready. Instead of immediately showing the window, realize it instead. This is pretty much the same thing except that it won't be visible while the async background loading happens. Then show it after the background is drawn. Signed-off-by: Eric Koegel eric.koe...@gmail.com src/xfce-desktop.c |1 + src/xfdesktop-application.c |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index d93535c..27df359 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -517,6 +517,7 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data) g_object_unref(G_OBJECT(pix)); cairo_destroy(cr); +gtk_widget_show(GTK_WIDGET(desktop)); } if(clip_region != NULL) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index af98380..91d25e6 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -678,7 +678,7 @@ xfdesktop_application_start(XfdesktopApplication *app) windowlist_attach(XFCE_DESKTOP(app-desktops[i])); /* display the desktop and try to put it at the bottom */ -gtk_widget_show(app-desktops[i]); +gtk_widget_realize(app-desktops[i]); gdk_window_lower(gtk_widget_get_window(app-desktops[i])); xfce_desktop_set_session_logout_func(XFCE_DESKTOP(app-desktops[i]), ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix a couple warning messages
Updating branch refs/heads/master to 7eef5d322ad5092b5839e37aae3aab98a91064ff (commit) from 92abe3c5a0a1991eef78fb9ce903aa279ab24abb (commit) commit 7eef5d322ad5092b5839e37aae3aab98a91064ff Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 15 17:30:15 2013 +0300 Fix a couple warning messages There were warning messages emitted when attempting to reload the desktop icons before xfdesktop was ever started. Also --version was unreffing the app object when it shouldn't. src/xfdesktop-application.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index bc95841..af98380 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -262,9 +262,6 @@ session_die(gpointer user_data) /* Cancel the wait for wm check if it's still running */ g_cancellable_cancel(app-cancel); -/* unhook our session quit function */ -g_signal_handlers_disconnect_by_func(app-sm_client, session_die, app); - for(main_level = gtk_main_level(); main_level 0; --main_level) gtk_main_quit(); @@ -356,7 +353,10 @@ reload_idle_cb(gpointer data) TRACE(entering); -g_return_if_fail(app-desktops); +/* If xfdesktop never started there's nothing to reload, xfdesktop will + * now startup */ +if(!app-desktops) +return FALSE; /* reload all the desktops */ for(i = 0; i app-nscreens; ++i) { @@ -434,7 +434,6 @@ xfdesktop_application_get_current_screen_number(XfdesktopApplication *app) screen_num = gdk_screen_get_number(screen); if(screen_num = app-nscreens) { -g_printerr(screen_num = app-nscreens); return -1; } @@ -833,8 +832,6 @@ xfdesktop_application_local_command_line(GApplication *g_application, #endif ); -/* free our memory and exit */ -g_object_unref(g_application); *exit_status = 0; return TRUE; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Make application source file strings translatable
Updating branch refs/heads/master to 4a33d012bb775c1d867f9dbd2431a5719a41e901 (commit) from 3df3613163fc6a0db624dbc86f743e5fd9983d4e (commit) commit 4a33d012bb775c1d867f9dbd2431a5719a41e901 Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 15 02:16:28 2013 +0300 Make application source file strings translatable po/POTFILES.in |1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 123841e..5410dea 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -14,6 +14,7 @@ src/xfce-backdrop.c src/xfce-desktop.c src/xfce-desktop-menu.c src/xfdesktop-app-menu-item.c +src/xfdesktop-application.c src/xfdesktop-clipboard-manager.c src/xfdesktop-file-icon.c src/xfdesktop-file-icon-manager.c ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Improve how backdrops are choosen
Updating branch refs/heads/master to c033f2db3efd826723cc2c54f6d1970b2bf308e4 (commit) from 4a33d012bb775c1d867f9dbd2431a5719a41e901 (commit) commit c033f2db3efd826723cc2c54f6d1970b2bf308e4 Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 15 02:17:47 2013 +0300 Improve how backdrops are choosen The patch changes it so that xfdesktop keeps the list of possible images in the same directory as the current file and sorts them the same way as xfdesktop-settings. This is to help make it more predicatable when xfdesktop advances the image. It will also monitor the directory of images for image files being added or removed. src/xfce-backdrop.c | 356 --- 1 file changed, 222 insertions(+), 134 deletions(-) diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index 11b950c..f0139f2 100644 --- a/src/xfce-backdrop.c +++ b/src/xfce-backdrop.c @@ -84,9 +84,9 @@ static void xfce_backdrop_file_input_stream_ready_cb(GObject *source_object, static void xfce_backdrop_image_data_release(XfceBackdropImageData *image_data); -gchar *xfce_backdrop_choose_next (const gchar *filename); -gchar *xfce_backdrop_choose_random (const gchar *filename); -gchar *xfce_backdrop_choose_chronological(const gchar *filename); +gchar *xfce_backdrop_choose_next (XfceBackdrop *backdrop); +gchar *xfce_backdrop_choose_random (XfceBackdrop *backdrop); +gchar *xfce_backdrop_choose_chronological(XfceBackdrop *backdrop); struct _XfceBackdropPriv { @@ -103,6 +103,10 @@ struct _XfceBackdropPriv XfceBackdropImageStyle image_style; gchar *image_path; +/* Cached list of images in the same folder as image_path */ +GList *image_files; +/* monitor for the image_files directory */ +GFileMonitor *monitor; gboolean cycle_backdrop; guint cycle_timer; @@ -241,9 +245,80 @@ xfce_backdrop_clear_cached_image(XfceBackdrop *backdrop) backdrop-priv-pix = NULL; } -/* Returns a GList of all the files in the parent directory of filename */ +/* we compare by the collate key so the image listing is the same as how + * xfdesktop-settings displays the images */ +static gint +compare_by_collate_key(const gchar *a, const gchar *b) +{ +gint ret; +gchar *a_key = g_utf8_collate_key_for_filename(a, -1); +gchar *b_key = g_utf8_collate_key_for_filename(b, -1); + +ret = g_strcmp0(a_key, b_key); + +g_free(a_key); +g_free(b_key); + +return ret; +} + +static void +cb_xfce_backdrop__image_files_changed(GFileMonitor *monitor, + GFile*file, + GFile*other_file, + GFileMonitorEvent event, + gpointer user_data) +{ +XfceBackdrop *backdrop = XFCE_BACKDROP(user_data); +gchar *changed_file = NULL; +GList *item; + +switch(event) { +case G_FILE_MONITOR_EVENT_CREATED: +changed_file = g_file_get_path(file); + +/* Make sure we don't already have the new file in the list */ +if(g_list_find(backdrop-priv-image_files, changed_file)) { +g_free(changed_file); +return; +} + +/* If the new file is not an image then we don't have to do + * anything */ +if(!xfdesktop_image_file_is_valid(changed_file)) { +g_free(changed_file); +return; +} + +/* It is an image file and we don't have it in our list, add it + * sorted to our list, don't free changed file, that will happen + * when it is removed */ +backdrop-priv-image_files = g_list_insert_sorted(backdrop-priv-image_files, + changed_file, + (GCompareFunc)compare_by_collate_key); +break; +case G_FILE_MONITOR_EVENT_DELETED: +changed_file = g_file_get_path(file); + +/* find the file in the list */ +item = g_list_find_custom(backdrop-priv-image_files, + changed_file, + (GCompareFunc)g_strcmp0); + +/* remove it */ +if(item) +backdrop-priv-image_files = g_list_delete_link(backdrop-priv-image_files, item); + +g_free(changed_file); +break; +default: +break; +} +} + +/* Returns a GList of all the image files in the parent directory of filename */ static GList * -list_files_in_dir(const gchar *filename) +list_image_files_in_dir(const gchar *filename) { GDir *dir; gboolean needs_slash = TRUE; @@ -265,8 +340,10 @@ list_files_in_dir(const gchar *filename) while((file = g_dir_read_name(dir
[Xfce4-commits] xfdesktop:master Wait for the window manager (Bug 7769)
Updating branch refs/heads/master to f8204f77cf48452b7021ee707369f6b69f322928 (commit) from 1d9dca11efbc9ac7f416d9c9dccb2049be2b5997 (commit) commit f8204f77cf48452b7021ee707369f6b69f322928 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 11:34:48 2013 +0300 Wait for the window manager (Bug 7769) When xfdesktop starts before the window manager the wallpaper images and icons won't appear on all the screens. This patch waits for the window manager to start up or 5 seconds before loading the desktops. Most of the actual checking if the wm is ready is based on a patch in xfce4-panel, commit-id cabbdfd1c04caf20a71e0af773accf809135a03d src/xfdesktop-application.c | 108 ++- 1 file changed, 107 insertions(+), 1 deletion(-) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index f52c821..8d528db 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -23,6 +23,9 @@ * Copyright (C) 2003 Benedikt Meurer benedikt.meu...@unix-ag.uni-siegen.de * X event forwarding code: * Copyright (c) 2004 Nils Rennebarth + * Additional portions taken from https://bugzilla.xfce.org/attachment.cgi?id=3751 + * which is in xfce4-panel git commit id 2a8de2b1b019eaef543e34764c999a409fe2bef9 + * and adapted for xfdesktop. */ #ifdef HAVE_CONFIG_H @@ -85,6 +88,9 @@ static void cb_xfdesktop_application_arrange(GAction *action, GVariant *parameter, gpointer data); +static gboolean cb_wait_for_window_manager(gpointer data); +static void cb_wait_for_window_manager_destroyed(gpointer data); + static void xfdesktop_application_startup(GApplication *g_application); static void xfdesktop_application_start(XfdesktopApplication *app); static void xfdesktop_application_shutdown(GApplication *g_application); @@ -95,6 +101,18 @@ static gboolean xfdesktop_application_local_command_line(GApplication *g_applica static gint xfdesktop_application_command_line(GApplication *g_application, GApplicationCommandLine *command_line); +typedef struct +{ +XfdesktopApplication *app; + +Display *dpy; +Atom *atoms; +guint atom_count; +guint have_wm : 1; +guint counter; +guint wait_for_wm_timeout_id; +} WaitForWM; + struct _XfdesktopApplication { GApplication parent; @@ -106,7 +124,10 @@ struct _XfdesktopApplication GtkWidget **desktops; XfconfChannel *channel; gint nscreens; +guint wait_for_wm_timeout_id; XfceSMClient *sm_client; + +gboolean opt_disable_wm_check; }; struct _XfdesktopApplicationClass @@ -405,16 +426,95 @@ cb_xfdesktop_application_arrange(GAction *action, xfce_desktop_arrange_icons(XFCE_DESKTOP(app-desktops[screen_num])); } +static gboolean +cb_wait_for_window_manager(gpointer data) +{ +WaitForWM *wfwm = data; +guint i; +gboolean have_wm = TRUE; + +for(i = 0; i wfwm-atom_count; i++) { +if(XGetSelectionOwner(wfwm-dpy, wfwm-atoms[i]) == None) { +DBG(window manager not ready on screen %d, i); +have_wm = FALSE; +break; +} +} + +wfwm-have_wm = have_wm; + +/* abort if a window manager is found or 5 seconds expired */ +return wfwm-counter++ 20 * 5 !wfwm-have_wm; +} + +static void +cb_wait_for_window_manager_destroyed(gpointer data) +{ +WaitForWM *wfwm = data; + +g_return_if_fail(wfwm-app != NULL); + +wfwm-app-wait_for_wm_timeout_id = 0; + +if(!wfwm-have_wm) { +g_printerr(No window manager registered on screen 0. + To start the xfdesktop without this check, run with --disable-wm-check.\n); +} else { +DBG(found window manager after %d tries, wfwm-counter); +} + +/* start loading the desktop, hopefully a window manager is found, but it + * also works without it */ +xfdesktop_application_start(wfwm-app); + +g_free(wfwm-atoms); +XCloseDisplay(wfwm-dpy); +g_slice_free(WaitForWM, wfwm); +} + static void xfdesktop_application_startup(GApplication *g_application) { XfdesktopApplication *app = XFDESKTOP_APPLICATION(g_application); +WaitForWM *wfwm; +guint i; +gchar **atom_names; TRACE(entering); g_application_hold(g_application); -xfdesktop_application_start(app); +if(!app-opt_disable_wm_check) { +/* setup data for wm checking */ +wfwm = g_slice_new0(WaitForWM); +wfwm-dpy = XOpenDisplay(NULL); +wfwm-have_wm = FALSE; +wfwm-counter = 0; +wfwm-app = app; + +/* preload wm atoms for all screens */ +wfwm-atom_count = XScreenCount(wfwm-dpy); +wfwm-atoms = g_new(Atom, wfwm-atom_count); +atom_names = g_new0(gchar *, wfwm-atom_count + 1); + +for(i = 0; i wfwm-atom_count; i
[Xfce4-commits] xfdesktop:master Merge branch 'eric/Port-to-GApplication'
Updating branch refs/heads/master to 46c09c3a910df3e71bf9b15f5488c8265816256c (commit) from 2e4d8d39015c87b4c91c6a0e9192dba123a0c681 (commit) commit 46c09c3a910df3e71bf9b15f5488c8265816256c Merge: 2e4d8d3 14fa81a Author: Eric Koegel eric.koe...@gmail.com Date: Thu Nov 14 02:37:07 2013 +0300 Merge branch 'eric/Port-to-GApplication' Conflicts: common/xfdesktop-common.c common/xfdesktop-common.h src/main.c commit 14fa81af7edeb570e6f3251ed9b3dc795560a328 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Nov 13 09:09:22 2013 +0300 xfdesktop-application code cleanup This patch also works around g_application_quit being too new. The startup operation can be canceled now, additional comments added and some sanity checks were added. commit 0efc8138db0b63262f1b674b49d2b23d92e4b37c Author: Eric Koegel eric.koe...@gmail.com Date: Mon Sep 23 14:10:27 2013 +0300 Tell session manage not to restart when quitting commit f8204f77cf48452b7021ee707369f6b69f322928 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 11:34:48 2013 +0300 Wait for the window manager (Bug 7769) When xfdesktop starts before the window manager the wallpaper images and icons won't appear on all the screens. This patch waits for the window manager to start up or 5 seconds before loading the desktops. Most of the actual checking if the wm is ready is based on a patch in xfce4-panel, commit-id cabbdfd1c04caf20a71e0af773accf809135a03d commit 1d9dca11efbc9ac7f416d9c9dccb2049be2b5997 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 10:50:39 2013 +0300 Workaround g_action_map being too new This adds in code for g_simple_action_group stuff so that it will work with glib versions earlier than 2.32. commit f4fa63b92f0ee07268f0af8b0bccb39a03c0e0e5 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 09:57:11 2013 +0300 Use the GApplication API Uses the GApplication API to handle process uniqueness, message passing, and lifecycle management. This eliminates the need to check if xfdesktop is already running and using X to forward events to the running instance of xfdesktop making it eaiser to port to GTK3 in the future (as well as GTKApplication). common/xfdesktop-common.c | 47 --- common/xfdesktop-common.h |3 - src/Makefile.am |4 +- src/main.c | 356 + src/xfce-desktop.c | 10 +- src/xfdesktop-application.c | 883 +++ src/xfdesktop-application.h | 47 +++ 7 files changed, 951 insertions(+), 399 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index ca6b89c..f36c500 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -120,53 +120,6 @@ xfdesktop_image_file_is_valid(const gchar *filename) return image_valid; } -gboolean -xfdesktop_check_is_running(Window *xid) -{ -const gchar *display = g_getenv(DISPLAY); -gchar *p; -gint xscreen = -1; -gchar selection_name[100]; -Atom selection_atom; - -if(display) { -if((p=g_strrstr(display, .))) -xscreen = atoi(p); -} -if(xscreen == -1) -xscreen = 0; - -g_snprintf(selection_name, 100, XFDESKTOP_SELECTION_FMT, xscreen); -selection_atom = XInternAtom(gdk_x11_get_default_xdisplay(), selection_name, False); - -if((*xid = XGetSelectionOwner(gdk_x11_get_default_xdisplay(), selection_atom))) -return TRUE; - -return FALSE; -} - -void -xfdesktop_send_client_message(Window xid, const gchar *msg) -{ -GdkEventClient gev; -GtkWidget *win; - -win = gtk_invisible_new(); -gtk_widget_realize(win); - -gev.type = GDK_CLIENT_EVENT; -gev.window = gtk_widget_get_window(win); -gev.send_event = TRUE; -gev.message_type = gdk_atom_intern(STRING, FALSE); -gev.data_format = 8; -strcpy(gev.data.b, msg); - -gdk_event_send_client_message((GdkEvent *)gev, (GdkNativeWindow)xid); -gdk_flush(); - -gtk_widget_destroy(win); -} - /* The image styles changed from versions prior to 4.11. * Auto isn't an option anymore, additionally we should handle invalid * values. Set them to the default of stretched. */ diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index e1b3878..78f543b 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -90,9 +90,6 @@ gboolean xfdesktop_image_file_is_valid(const gchar *filename); gchar *xfdesktop_get_file_mimetype(const gchar *file); -gboolean xfdesktop_check_is_running(Window *xid); -void xfdesktop_send_client_message(Window xid, const gchar *msg); - gint xfce_translate_image_styles(gint input); guint32 xfdesktop_popup_keyboard_grab_available(GdkWindow *win); diff --git a/src/Makefile.am b/src/Makefile.am index 4d73dad..42667a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am
[Xfce4-commits] xfdesktop:master Tell session manage not to restart when quitting
Updating branch refs/heads/master to 0efc8138db0b63262f1b674b49d2b23d92e4b37c (commit) from f8204f77cf48452b7021ee707369f6b69f322928 (commit) commit 0efc8138db0b63262f1b674b49d2b23d92e4b37c Author: Eric Koegel eric.koe...@gmail.com Date: Mon Sep 23 14:10:27 2013 +0300 Tell session manage not to restart when quitting src/xfdesktop-application.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index 8d528db..997b4f2 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -349,6 +349,12 @@ xfdesktop_handle_quit_signals(gint sig, gpointer user_data) { gint main_level; +XfdesktopApplication *app = XFDESKTOP_APPLICATION(user_data); + +if(app-sm_client XFCE_IS_SM_CLIENT(app-sm_client)) { +xfce_sm_client_set_restart_style(app-sm_client, + XFCE_SM_CLIENT_RESTART_NORMAL); +} for(main_level = gtk_main_level(); main_level 0; --main_level) gtk_main_quit(); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Add an info bar to the settings app (Bug 10460)
Updating branch refs/heads/master to 9a7b5c1381b8047dc97d2080a6274b2d468987e1 (commit) from 2456c1974cace0cb0494638146c33a88737cf6a9 (commit) commit 9a7b5c1381b8047dc97d2080a6274b2d468987e1 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Nov 13 14:57:11 2013 +0300 Add an info bar to the settings app (Bug 10460) The info bar will be used to notify the user that dragging the window to another monitor or workspace will allow them to change those settings. This should help user's customize those settings. settings/main.c| 45 +- .../xfdesktop-settings-appearance-frame-ui.glade | 571 ++-- 2 files changed, 332 insertions(+), 284 deletions(-) diff --git a/settings/main.c b/settings/main.c index a46d608..d64bf81 100644 --- a/settings/main.c +++ b/settings/main.c @@ -99,6 +99,8 @@ typedef struct * wnck_screen_get_active_workspace sometimes has to return NULL. */ gint active_workspace; +GtkWidget *infobar; +GtkWidget *infobar_label; GtkWidget *label_header; GtkWidget *image_iconview; GtkWidget *btn_folder; @@ -680,6 +682,14 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel, } else { g_snprintf(buf, sizeof(buf), _(Wallpaper for Monitor %d), panel-monitor); } + +/* This is for the infobar letting the user know how to configure + * multiple monitor setups */ +gtk_label_set_text(GTK_LABEL(panel-infobar_label), + _(You are using more than one display, + move this dialog to the display you + want to edit the settings for.)); +gtk_widget_set_visible(panel-infobar, TRUE); } else { /* Multi-monitor per workspace wallpaper */ if(panel-monitor_name) { @@ -691,17 +701,36 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel, _(Wallpaper for %s on Monitor %d), workspace_name, panel-monitor); } + +/* This is for the infobar letting the user know how to configure + * multiple monitor/workspace setups */ +gtk_label_set_text(GTK_LABEL(panel-infobar_label), + _(You are using more than one display, + move this dialog to the display and + workspace you want to edit the settings for.)); +gtk_widget_set_visible(panel-infobar, TRUE); } } else { if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel-chk_apply_to_all))) { /* Single monitor and single workspace */ g_snprintf(buf, sizeof(buf), _(Wallpaper for my desktop)); + +/* No need for the infobar */ +gtk_widget_set_visible(panel-infobar, FALSE); } else { /* Single monitor and per workspace wallpaper */ g_snprintf(buf, sizeof(buf), _(Wallpaper for %s), workspace_name); + +/* This is for the infobar letting the user know how to configure + * multiple workspace setups */ +gtk_label_set_text(GTK_LABEL(panel-infobar_label), + _(Move this dialog to the workspace you + want to edit the settings for.)); +gtk_widget_set_visible(panel-infobar, TRUE); } } +/* This label is for which workspace/monitor we're on */ gtk_label_set_text(GTK_LABEL(panel-label_header), buf); g_free(workspace_name); @@ -1619,7 +1648,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, GtkWidget *appearance_container, *chk_custom_font_size, *spin_font_size, *w, *box, *spin_icon_size, *chk_show_thumbnails, *chk_single_click, *appearance_settings, - *chk_show_tooltips, *spin_tooltip_size, *bnt_exit; + *chk_show_tooltips, *spin_tooltip_size, *bnt_exit, *content_area; GtkBuilder *appearance_gxml; AppearancePanel *panel = g_new0(AppearancePanel, 1); GError *error = NULL; @@ -1728,6 +1757,20 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, gtk_notebook_set_show_tabs(GTK_NOTEBOOK(appearance_container), FALSE); /* icon view area */ +panel-infobar = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, + infobar_header)); + +panel-infobar_label = gtk_label_new(This is some text); +gtk_widget_set_no_show_all(panel-infobar, TRUE); +gtk_widget_show(panel-infobar_label); +gtk_widget_show(panel-infobar); +gtk_widget_set_visible(panel-infobar, FALSE); + +/* Add the panel's infobar label to the infobar, with this setup + * it's easy to update the text for the infobar
[Xfce4-commits] xfdesktop:master Workaround g_action_map being too new
Updating branch refs/heads/master to 1d9dca11efbc9ac7f416d9c9dccb2049be2b5997 (commit) from f4fa63b92f0ee07268f0af8b0bccb39a03c0e0e5 (commit) commit 1d9dca11efbc9ac7f416d9c9dccb2049be2b5997 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 10:50:39 2013 +0300 Workaround g_action_map being too new This adds in code for g_simple_action_group stuff so that it will work with glib versions earlier than 2.32. src/xfdesktop-application.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index f1b2944..f52c821 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -99,6 +99,10 @@ struct _XfdesktopApplication { GApplication parent; +#if !GLIB_CHECK_VERSION (2, 32, 0) +GSimpleActionGroup *actions; +#endif + GtkWidget **desktops; XfconfChannel *channel; gint nscreens; @@ -130,33 +134,51 @@ xfdesktop_application_class_init(XfdesktopApplicationClass *klass) } static void +xfdesktop_application_add_action(XfdesktopApplication *app, GAction *action) +{ +#if GLIB_CHECK_VERSION (2, 32, 0) +g_action_map_add_action(G_ACTION_MAP(app), action); +#else +g_simple_action_group_insert(app-actions, action); +#endif +} + +static void xfdesktop_application_init(XfdesktopApplication *app) { GSimpleAction *action; +#if !GLIB_CHECK_VERSION (2, 32, 0) +app-actions = g_simple_action_group_new(); +#endif + /* reload action */ action = g_simple_action_new(reload, NULL); g_signal_connect(action, activate, G_CALLBACK(cb_xfdesktop_application_reload), app); -g_action_map_add_action(G_ACTION_MAP(app), G_ACTION(action)); +xfdesktop_application_add_action(app, G_ACTION(action)); g_object_unref(action); /* quit action */ action = g_simple_action_new(quit, NULL); g_signal_connect(action, activate, G_CALLBACK(cb_xfdesktop_application_quit), app); -g_action_map_add_action(G_ACTION_MAP(app), G_ACTION(action)); +xfdesktop_application_add_action(app, G_ACTION(action)); g_object_unref(action); /* menu action, parameter pops up primary (TRUE) or windowlist menu */ action = g_simple_action_new(menu, G_VARIANT_TYPE_BOOLEAN); g_signal_connect(action, activate, G_CALLBACK(cb_xfdesktop_application_menu), app); -g_action_map_add_action(G_ACTION_MAP(app), G_ACTION(action)); +xfdesktop_application_add_action(app, G_ACTION(action)); g_object_unref(action); /* arrange action */ action = g_simple_action_new(arrange, NULL); g_signal_connect(action, activate, G_CALLBACK(cb_xfdesktop_application_arrange), app); -g_action_map_add_action(G_ACTION_MAP(app), G_ACTION(action)); +xfdesktop_application_add_action(app, G_ACTION(action)); g_object_unref(action); + +#if !GLIB_CHECK_VERSION (2, 32, 0) +g_application_set_action_group(G_APPLICATION(app), (GActionGroup*)app-actions); +#endif } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master xfdesktop-application code cleanup
Updating branch refs/heads/master to 14fa81af7edeb570e6f3251ed9b3dc795560a328 (commit) from 0efc8138db0b63262f1b674b49d2b23d92e4b37c (commit) commit 14fa81af7edeb570e6f3251ed9b3dc795560a328 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Nov 13 09:09:22 2013 +0300 xfdesktop-application code cleanup This patch also works around g_application_quit being too new. The startup operation can be canceled now, additional comments added and some sanity checks were added. src/xfce-desktop.c | 10 ++- src/xfdesktop-application.c | 197 ++- 2 files changed, 165 insertions(+), 42 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index b35a0a1..a0931ff 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1094,15 +1094,17 @@ xfce_desktop_unrealize(GtkWidget *widget) gdk_flush(); gdk_error_trap_pop(); -g_object_unref(G_OBJECT(desktop-priv-bg_pixmap)); -desktop-priv-bg_pixmap = NULL; +if(desktop-priv-bg_pixmap) { +g_object_unref(G_OBJECT(desktop-priv-bg_pixmap)); +desktop-priv-bg_pixmap = NULL; +} gtk_window_set_icon(GTK_WINDOW(widget), NULL); - + gtk_style_detach(gtk_widget_get_style(widget)); g_object_unref(G_OBJECT(gtk_widget_get_window(widget))); gtk_widget_set_window(widget, NULL); - + gtk_selection_remove_all(widget); gtk_widget_set_realized(widget, FALSE); diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index 997b4f2..bc95841 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -126,6 +126,7 @@ struct _XfdesktopApplication gint nscreens; guint wait_for_wm_timeout_id; XfceSMClient *sm_client; +GCancellable *cancel; gboolean opt_disable_wm_check; }; @@ -169,6 +170,8 @@ xfdesktop_application_init(XfdesktopApplication *app) { GSimpleAction *action; +app-cancel = g_cancellable_new(); + #if !GLIB_CHECK_VERSION (2, 32, 0) app-actions = g_simple_action_group_new(); #endif @@ -208,18 +211,25 @@ xfdesktop_application_finalize(GObject *object) G_OBJECT_CLASS(xfdesktop_application_parent_class)-finalize(object); } +/** + * xfdesktop_application_get: + * + * Singleton. Additional calls increase the reference count. + * + * Return value: #XfdesktopApplication, free with g_object_unref. + **/ XfdesktopApplication * xfdesktop_application_get(void) { static XfdesktopApplication *app = NULL; -if(app) { -g_object_ref(G_OBJECT(app)); +if(app == NULL) { + app = g_object_new(XFDESKTOP_TYPE_APPLICATION, + application-id, org.xfce.xfdesktop, + flags, G_APPLICATION_HANDLES_COMMAND_LINE, + NULL); } else { - app = g_object_new(XFDESKTOP_TYPE_APPLICATION, - application-id, org.xfce.xfdesktop, - flags, G_APPLICATION_HANDLES_COMMAND_LINE, - NULL); +g_object_ref(app); } return app; @@ -237,8 +247,32 @@ session_logout(void) static void session_die(gpointer user_data) { -gtk_main_quit(); -g_application_quit(G_APPLICATION(user_data)); +gint main_level; +XfdesktopApplication *app; + +TRACE(entering); + +/* If we somehow got here after the app has been released we don't need + * to do anything */ +if(user_data == NULL || !XFDESKTOP_IS_APPLICATION(user_data)) +return; + +app = XFDESKTOP_APPLICATION(user_data); + +/* Cancel the wait for wm check if it's still running */ +g_cancellable_cancel(app-cancel); + +/* unhook our session quit function */ +g_signal_handlers_disconnect_by_func(app-sm_client, session_die, app); + +for(main_level = gtk_main_level(); main_level 0; --main_level) +gtk_main_quit(); + +#if GLIB_CHECK_VERSION(2, 32, 0) +g_application_quit(G_APPLICATION(app)); +#else +xfdesktop_application_shutdown(G_APPLICATION(app)); +#endif } static void @@ -322,6 +356,9 @@ reload_idle_cb(gpointer data) TRACE(entering); +g_return_if_fail(app-desktops); + +/* reload all the desktops */ for(i = 0; i app-nscreens; ++i) { if(app-desktops[i]) xfce_desktop_refresh(XFCE_DESKTOP(app-desktops[i])); @@ -339,7 +376,14 @@ cb_xfdesktop_application_reload(GAction *action, GVariant *parameter, gpointer data) { -GApplication *g_application = G_APPLICATION(data); +GApplication *g_application; + +if(!data || !G_IS_APPLICATION(data)) +return; + +g_application = G_APPLICATION(data); + +/* hold the app so it doesn't quit while a queue up a refresh */ g_application_hold(g_application); g_idle_add((GSourceFunc)reload_idle_cb, g_application); } @@ -348,18 +392,11 @@ static void xfdesktop_handle_quit_signals(gint sig
[Xfce4-commits] xfdesktop:master Use the GApplication API
Updating branch refs/heads/master to f4fa63b92f0ee07268f0af8b0bccb39a03c0e0e5 (commit) from c014cb3231259ea4ffc4477f7ce7c7531f1c5d12 (commit) commit f4fa63b92f0ee07268f0af8b0bccb39a03c0e0e5 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Sep 21 09:57:11 2013 +0300 Use the GApplication API Uses the GApplication API to handle process uniqueness, message passing, and lifecycle management. This eliminates the need to check if xfdesktop is already running and using X to forward events to the running instance of xfdesktop making it eaiser to port to GTK3 in the future (as well as GTKApplication). common/xfdesktop-common.c | 47 common/xfdesktop-common.h |3 - src/Makefile.am |4 +- src/main.c | 359 + src/xfdesktop-application.c | 628 +++ src/xfdesktop-application.h | 47 6 files changed, 692 insertions(+), 396 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 65f0214..f97f9d6 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -254,53 +254,6 @@ xfdesktop_image_file_is_valid(const gchar *filename) return image_valid; } -gboolean -xfdesktop_check_is_running(Window *xid) -{ -const gchar *display = g_getenv(DISPLAY); -gchar *p; -gint xscreen = -1; -gchar selection_name[100]; -Atom selection_atom; - -if(display) { -if((p=g_strrstr(display, .))) -xscreen = atoi(p); -} -if(xscreen == -1) -xscreen = 0; - -g_snprintf(selection_name, 100, XFDESKTOP_SELECTION_FMT, xscreen); -selection_atom = XInternAtom(gdk_x11_get_default_xdisplay(), selection_name, False); - -if((*xid = XGetSelectionOwner(gdk_x11_get_default_xdisplay(), selection_atom))) -return TRUE; - -return FALSE; -} - -void -xfdesktop_send_client_message(Window xid, const gchar *msg) -{ -GdkEventClient gev; -GtkWidget *win; - -win = gtk_invisible_new(); -gtk_widget_realize(win); - -gev.type = GDK_CLIENT_EVENT; -gev.window = gtk_widget_get_window(win); -gev.send_event = TRUE; -gev.message_type = gdk_atom_intern(STRING, FALSE); -gev.data_format = 8; -strcpy(gev.data.b, msg); - -gdk_event_send_client_message((GdkEvent *)gev, (GdkNativeWindow)xid); -gdk_flush(); - -gtk_widget_destroy(win); -} - guint xfce_grab_cursor(GtkWidget *w, GdkEventButton *evt) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 1d6db85..903875d 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -83,9 +83,6 @@ gboolean xfdesktop_image_file_is_valid(const gchar *filename); gchar *xfdesktop_get_file_mimetype(const gchar *file); -gboolean xfdesktop_check_is_running(Window *xid); -void xfdesktop_send_client_message(Window xid, const gchar *msg); - guint xfce_grab_cursor(GtkWidget *w, GdkEventButton *evt); gboolean xfdesktop_popup_grab_available(GdkWindow *win, guint32 timestamp); diff --git a/src/Makefile.am b/src/Makefile.am index 4d73dad..42667a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,9 @@ xfdesktop_SOURCES = \ xfce-workspace.c \ xfce-workspace.h \ xfce-desktop.c \ - xfce-desktop.h + xfce-desktop.h \ + xfdesktop-application.c \ + xfdesktop-application.h desktop_icon_sources = \ xfdesktop-icon.c \ diff --git a/src/main.c b/src/main.c index d0f24bc..db6 100644 --- a/src/main.c +++ b/src/main.c @@ -48,207 +48,27 @@ #include unistd.h #endif -#include X11/Xlib.h - -#include gdk/gdkx.h -#include gtk/gtk.h - -#include xfconf/xfconf.h -#include libxfce4ui/libxfce4ui.h - #ifdef ENABLE_FILE_ICONS #include dbus/dbus-glib.h #endif -#include xfdesktop-common.h -#include xfce-backdrop.h -#include xfce-desktop.h -#include menu.h -#include windowlist.h - -#ifdef HAVE_LIBNOTIFY -#include xfdesktop-notify.h -#endif - -static XfceSMClient *sm_client = NULL; - -static void -session_logout(void) -{ -xfce_sm_client_request_shutdown(sm_client, XFCE_SM_CLIENT_SHUTDOWN_HINT_ASK); -} - -static void -session_die(gpointer user_data) -{ -gtk_main_quit(); -} - -static void -event_forward_to_rootwin(GdkScreen *gscreen, GdkEvent *event) -{ -XButtonEvent xev, xev2; -Display *dpy = GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(gscreen)); - -if(event-type == GDK_BUTTON_PRESS || event-type == GDK_BUTTON_RELEASE) { -if(event-type == GDK_BUTTON_PRESS) { -xev.type = ButtonPress; -/* - * rox has an option to disable the next - * instruction. it is called blackbox_hack. Does - * anyone know why exactly it is needed? - */ -XUngrabPointer(dpy, event-button.time); -} else -xev.type = ButtonRelease; - -xev.button = event-button.button; -xev.x
[Xfce4-commits] xfdesktop:master Use a label instead of a frame
Updating branch refs/heads/master to 2456c1974cace0cb0494638146c33a88737cf6a9 (commit) from 46c09c3a910df3e71bf9b15f5488c8265816256c (commit) commit 2456c1974cace0cb0494638146c33a88737cf6a9 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Nov 13 14:54:31 2013 +0300 Use a label instead of a frame In the xfdesktop-settings app use just a label instead of a frame above the icon view in the background tab. This will make it look consistant with the other tabs. settings/main.c| 11 +- .../xfdesktop-settings-appearance-frame-ui.glade | 560 ++-- settings/xfdesktop-settings-ui.glade |1 + 3 files changed, 291 insertions(+), 281 deletions(-) diff --git a/settings/main.c b/settings/main.c index 050a4d5..a46d608 100644 --- a/settings/main.c +++ b/settings/main.c @@ -99,7 +99,7 @@ typedef struct * wnck_screen_get_active_workspace sometimes has to return NULL. */ gint active_workspace; -GtkWidget *frame_image_list; +GtkWidget *label_header; GtkWidget *image_iconview; GtkWidget *btn_folder; GtkWidget *chk_apply_to_all; @@ -702,7 +702,7 @@ xfdesktop_settings_update_iconview_frame_name(AppearancePanel *panel, } } -gtk_frame_set_label(GTK_FRAME(panel-frame_image_list), buf); +gtk_label_set_text(GTK_LABEL(panel-label_header), buf); g_free(workspace_name); } @@ -1721,9 +1721,6 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, appearance_settings = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, alignment_settings)); -panel-frame_image_list = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, - frame_image_list)); - /* Add the background tab widgets to the main window and don't display the * notebook label/tab */ gtk_notebook_append_page(GTK_NOTEBOOK(appearance_container), @@ -1731,8 +1728,8 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, gtk_notebook_set_show_tabs(GTK_NOTEBOOK(appearance_container), FALSE); /* icon view area */ -panel-frame_image_list = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, - frame_image_list)); +panel-label_header = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, +label_header)); panel-image_iconview = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, iconview_imagelist)); diff --git a/settings/xfdesktop-settings-appearance-frame-ui.glade b/settings/xfdesktop-settings-appearance-frame-ui.glade index a86ed18..100abea 100644 --- a/settings/xfdesktop-settings-appearance-frame-ui.glade +++ b/settings/xfdesktop-settings-appearance-frame-ui.glade @@ -34,312 +34,324 @@ property name=border_width12/property property name=left_padding6/property child - object class=GtkFrame id=frame_image_list + object class=GtkAlignment id=top_padding_alignment property name=visibleTrue/property -property name=label_xalign0/property -property name=shadow_typeGTK_SHADOW_NONE/property +property name=top_padding6/property child - object class=GtkAlignment id=top_padding_alignment + object class=GtkVBox id=background_tab_vbox property name=visibleTrue/property -property name=top_padding6/property +property name=spacing6/property child - object class=GtkVBox id=background_tab_vbox + object class=GtkHBox id=background_tab_hbox property name=visibleTrue/property -property name=spacing6/property child - object class=GtkScrolledWindow id=iconview_imagelist_scrolled_window + object class=GtkLabel id=label_header property name=visibleTrue/property -property name=can_focusTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=hscrollbar_policyGTK_POLICY_AUTOMATIC/property -property name=vscrollbar_policyGTK_POLICY_AUTOMATIC/property -property name=shadow_typeGTK_SHADOW_ETCHED_IN/property -child - object class=GtkIconView id=iconview_imagelist -property name=visibleTrue/property -property name=can_focusTrue/property -property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property
[Xfce4-commits] xfdesktop:eric/Port-to-GApplication xfdesktop-application code cleanup
Updating branch refs/heads/eric/Port-to-GApplication to 14fa81af7edeb570e6f3251ed9b3dc795560a328 (commit) from 0efc8138db0b63262f1b674b49d2b23d92e4b37c (commit) commit 14fa81af7edeb570e6f3251ed9b3dc795560a328 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Nov 13 09:09:22 2013 +0300 xfdesktop-application code cleanup This patch also works around g_application_quit being too new. The startup operation can be canceled now, additional comments added and some sanity checks were added. src/xfce-desktop.c | 10 ++- src/xfdesktop-application.c | 197 ++- 2 files changed, 165 insertions(+), 42 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index b35a0a1..a0931ff 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1094,15 +1094,17 @@ xfce_desktop_unrealize(GtkWidget *widget) gdk_flush(); gdk_error_trap_pop(); -g_object_unref(G_OBJECT(desktop-priv-bg_pixmap)); -desktop-priv-bg_pixmap = NULL; +if(desktop-priv-bg_pixmap) { +g_object_unref(G_OBJECT(desktop-priv-bg_pixmap)); +desktop-priv-bg_pixmap = NULL; +} gtk_window_set_icon(GTK_WINDOW(widget), NULL); - + gtk_style_detach(gtk_widget_get_style(widget)); g_object_unref(G_OBJECT(gtk_widget_get_window(widget))); gtk_widget_set_window(widget, NULL); - + gtk_selection_remove_all(widget); gtk_widget_set_realized(widget, FALSE); diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c index 997b4f2..bc95841 100644 --- a/src/xfdesktop-application.c +++ b/src/xfdesktop-application.c @@ -126,6 +126,7 @@ struct _XfdesktopApplication gint nscreens; guint wait_for_wm_timeout_id; XfceSMClient *sm_client; +GCancellable *cancel; gboolean opt_disable_wm_check; }; @@ -169,6 +170,8 @@ xfdesktop_application_init(XfdesktopApplication *app) { GSimpleAction *action; +app-cancel = g_cancellable_new(); + #if !GLIB_CHECK_VERSION (2, 32, 0) app-actions = g_simple_action_group_new(); #endif @@ -208,18 +211,25 @@ xfdesktop_application_finalize(GObject *object) G_OBJECT_CLASS(xfdesktop_application_parent_class)-finalize(object); } +/** + * xfdesktop_application_get: + * + * Singleton. Additional calls increase the reference count. + * + * Return value: #XfdesktopApplication, free with g_object_unref. + **/ XfdesktopApplication * xfdesktop_application_get(void) { static XfdesktopApplication *app = NULL; -if(app) { -g_object_ref(G_OBJECT(app)); +if(app == NULL) { + app = g_object_new(XFDESKTOP_TYPE_APPLICATION, + application-id, org.xfce.xfdesktop, + flags, G_APPLICATION_HANDLES_COMMAND_LINE, + NULL); } else { - app = g_object_new(XFDESKTOP_TYPE_APPLICATION, - application-id, org.xfce.xfdesktop, - flags, G_APPLICATION_HANDLES_COMMAND_LINE, - NULL); +g_object_ref(app); } return app; @@ -237,8 +247,32 @@ session_logout(void) static void session_die(gpointer user_data) { -gtk_main_quit(); -g_application_quit(G_APPLICATION(user_data)); +gint main_level; +XfdesktopApplication *app; + +TRACE(entering); + +/* If we somehow got here after the app has been released we don't need + * to do anything */ +if(user_data == NULL || !XFDESKTOP_IS_APPLICATION(user_data)) +return; + +app = XFDESKTOP_APPLICATION(user_data); + +/* Cancel the wait for wm check if it's still running */ +g_cancellable_cancel(app-cancel); + +/* unhook our session quit function */ +g_signal_handlers_disconnect_by_func(app-sm_client, session_die, app); + +for(main_level = gtk_main_level(); main_level 0; --main_level) +gtk_main_quit(); + +#if GLIB_CHECK_VERSION(2, 32, 0) +g_application_quit(G_APPLICATION(app)); +#else +xfdesktop_application_shutdown(G_APPLICATION(app)); +#endif } static void @@ -322,6 +356,9 @@ reload_idle_cb(gpointer data) TRACE(entering); +g_return_if_fail(app-desktops); + +/* reload all the desktops */ for(i = 0; i app-nscreens; ++i) { if(app-desktops[i]) xfce_desktop_refresh(XFCE_DESKTOP(app-desktops[i])); @@ -339,7 +376,14 @@ cb_xfdesktop_application_reload(GAction *action, GVariant *parameter, gpointer data) { -GApplication *g_application = G_APPLICATION(data); +GApplication *g_application; + +if(!data || !G_IS_APPLICATION(data)) +return; + +g_application = G_APPLICATION(data); + +/* hold the app so it doesn't quit while a queue up a refresh */ g_application_hold(g_application); g_idle_add((GSourceFunc)reload_idle_cb, g_application); } @@ -348,18 +392,11 @@ static void
[Xfce4-commits] xfdesktop:master Fix icons for .desktop files with absolute paths
Updating branch refs/heads/master to 9797cb5493524eaf786e49a665f11cf9869dbe88 (commit) from 7d7ce99052f57600d12b8f077fecf1b1a9ca8e25 (commit) commit 9797cb5493524eaf786e49a665f11cf9869dbe88 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Nov 10 09:21:19 2013 +0300 Fix icons for .desktop files with absolute paths src/xfdesktop-regular-file-icon.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c index b0ca4c7..44c7b75 100644 --- a/src/xfdesktop-regular-file-icon.c +++ b/src/xfdesktop-regular-file-icon.c @@ -261,11 +261,16 @@ xfdesktop_load_icon_from_desktop_file(XfdesktopRegularFileIcon *regular_icon) G_KEY_FILE_DESKTOP_KEY_ICON, NULL); -/* Create the themed icon for it */ -if(icon_name) { +if(icon_name g_file_test(icon_name, G_FILE_TEST_IS_REGULAR)) { +/* icon_name is an absolute path, create it as a file icon */ +gicon = g_file_icon_new(g_file_new_for_path(icon_name)); +} else if(icon_name) { +/* otherwise create a themed icon for it */ gicon = g_themed_icon_new(icon_name); -g_free(icon_name); } + +if(icon_name) +g_free(icon_name); } /* free key file and in-memory data */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix icon renames causing duplicate icons
Updating branch refs/heads/master to bdfd3970d31218643fe0e2a89079cd6817aafb4a (commit) from 9797cb5493524eaf786e49a665f11cf9869dbe88 (commit) commit bdfd3970d31218643fe0e2a89079cd6817aafb4a Author: Eric Koegel eric.koe...@gmail.com Date: Mon Nov 11 15:14:53 2013 +0300 Fix icon renames causing duplicate icons Some programs cause rename move/change/delete events in different orders. This patch fixes it so there won't be duplicate icons on the desktop. It also consolidates the icon removal code in the icon file manager so it isn't duplicated anywhere. src/xfdesktop-file-icon-manager.c | 94 +++-- 1 file changed, 70 insertions(+), 24 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 5f8bdb1..239d064 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2156,6 +2156,43 @@ xfdesktop_file_icon_manager_add_icon(XfdesktopFileIconManager *fmanager, } +static void +xfdesktop_file_icon_manager_remove_icon(XfdesktopFileIconManager *fmanager, +XfdesktopFileIcon *icon) +{ +GList *item = NULL; + +g_return_if_fail(XFDESKTOP_IS_FILE_ICON_MANAGER(fmanager)); +g_return_if_fail(XFDESKTOP_IS_FILE_ICON(icon)); + +/* find out if the icon was pending creation */ +if(fmanager-priv-pending_icons) +item = g_queue_find(fmanager-priv-pending_icons, icon); + +if(item item-data XFDESKTOP_IS_FILE_ICON(item-data)) { +gchar *filename = g_file_get_path(xfdesktop_file_icon_peek_file(item-data)); + +DBG(removing %s from pending queue, filename); + +/* Icon was pending creation, dequeue the thumbnail and + * remove it from the pending icons queue */ +xfdesktop_thumbnailer_dequeue_thumbnail(fmanager-priv-thumbnailer, +filename); + +g_queue_remove(fmanager-priv-pending_icons, icon); + +g_free(filename); +} else { +DBG(removing icon %s from icon view, xfdesktop_icon_peek_label(XFDESKTOP_ICON(icon))); +/* Remove the icon from the icon_view */ +xfdesktop_icon_view_remove_item(fmanager-priv-icon_view, +XFDESKTOP_ICON(icon)); +} + +/* Remove the icon from the hash table */ +g_hash_table_remove(fmanager-priv-icons, xfdesktop_file_icon_peek_file(icon)); +} + /* If row and col are set then they will be used, otherwise set them to -1 * and it will lookup the position in the rc file */ static XfdesktopFileIcon * @@ -2458,7 +2495,7 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, gpointer user_data) { XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data); -XfdesktopFileIcon *icon; +XfdesktopFileIcon *icon, *moved_icon; GFileInfo *file_info; guint16 row, col; gchar *filename; @@ -2472,30 +2509,42 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, file_info = g_file_query_info(other_file, XFDESKTOP_FILE_INFO_NAMESPACE, G_FILE_QUERY_INFO_NONE, NULL, NULL); +if(icon) { +/* Get the old position so we can use it for the new icon */ +xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col); +DBG(row %d, col %d, row, col); + +/* Remove the old icon */ +xfdesktop_file_icon_manager_remove_icon(fmanager, icon); +} + +/* Check to see if there's already an other_file represented on + * the desktop and remove it so there aren't duplicated icons + * present. */ +moved_icon = g_hash_table_lookup(fmanager-priv-icons, other_file); +if(moved_icon) { +/* Since we're replacing an existing icon, get that location + * to use instead */ +xfdesktop_icon_get_position(XFDESKTOP_ICON(moved_icon), row, col); +DBG(row %d, col %d, row, col); + +xfdesktop_file_icon_manager_remove_icon(fmanager, moved_icon); +} + if(file_info) { gboolean is_hidden; -if(icon) { -/* Get the old position so we can use it for the new icon */ -xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col); - -/* Remove the icon from the icon_view and this manager's - * hash table */ -xfdesktop_icon_view_remove_item(fmanager-priv-icon_view, -XFDESKTOP_ICON(icon)); -g_hash_table_remove(fmanager-priv-icons, file); -} is_hidden = g_file_info_get_attribute_boolean(file_info
[Xfce4-commits] xfdesktop:master Don't show hidden or backup files on the desktop (Bug 9001)
Updating branch refs/heads/master to 91f8183252ed809502b1ff36cd51a385e9f11848 (commit) from f33d91b16c38deb6f2a788b1a78c9676e04255b3 (commit) commit 91f8183252ed809502b1ff36cd51a385e9f11848 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Nov 10 08:52:03 2013 +0300 Don't show hidden or backup files on the desktop (Bug 9001) src/xfdesktop-file-icon-manager.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 859f8c0..5f8bdb1 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2216,7 +2216,11 @@ xfdesktop_file_icon_manager_add_regular_icon(XfdesktopFileIconManager *fmanager, xfce_rc_close(rcfile); } } - + +/* If it's a hidden or backup file don't show it on the desktop */ +if(g_file_info_get_is_hidden(info) || g_file_info_get_is_backup(info)) +return NULL; + /* should never return NULL */ icon = xfdesktop_regular_file_icon_new(file, info, fmanager-priv-gscreen); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix keyboard navigation in settings app
Updating branch refs/heads/master to 013856d55f3d8576494034d875173660bfec3f71 (commit) from c81192e242f2c715ea88602f1434b5c76093aa2b (commit) commit 013856d55f3d8576494034d875173660bfec3f71 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Nov 3 09:35:36 2013 +0300 Fix keyboard navigation in settings app This also improves the keyboard mnemonics for the controls on the background tab. settings/main.c |7 +-- settings/xfdesktop-settings-appearance-frame-ui.glade | 11 ++- settings/xfdesktop-settings-ui.glade |2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/settings/main.c b/settings/main.c index f5d59dd..050a4d5 100644 --- a/settings/main.c +++ b/settings/main.c @@ -1724,8 +1724,11 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, panel-frame_image_list = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, frame_image_list)); -gtk_table_attach_defaults(GTK_TABLE(appearance_container), - appearance_settings, 0,1,0,1); +/* Add the background tab widgets to the main window and don't display the + * notebook label/tab */ +gtk_notebook_append_page(GTK_NOTEBOOK(appearance_container), + appearance_settings, NULL); +gtk_notebook_set_show_tabs(GTK_NOTEBOOK(appearance_container), FALSE); /* icon view area */ panel-frame_image_list = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, diff --git a/settings/xfdesktop-settings-appearance-frame-ui.glade b/settings/xfdesktop-settings-appearance-frame-ui.glade index f992dae..a86ed18 100644 --- a/settings/xfdesktop-settings-appearance-frame-ui.glade +++ b/settings/xfdesktop-settings-appearance-frame-ui.glade @@ -78,8 +78,9 @@ object class=GtkLabel id=label_folder property name=visibleTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=label translatable=yesFolder:/property +property name=label translatable=yes_Folder:/property property name=use_underlineTrue/property +property name=mnemonic_widgetbtn_folder/property /object packing property name=left-attach0/property @@ -94,7 +95,6 @@ object class=GtkFileChooserButton id=btn_folder property name=visibleTrue/property property name=can_focusTrue/property -property name=receives_defaultTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property property name=tooltip-text translatable=yesChoose the folder to select wallpapers from/property property name=actionGTK_FILE_CHOOSER_ACTION_SELECT_FOLDER/property @@ -166,8 +166,9 @@ object class=GtkLabel id=label_color property name=visibleTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=label translatable=yesColor:/property +property name=label translatable=yesC_olor:/property property name=use_underlineTrue/property +property name=mnemonic_widgetcombo_colors/property /object packing property name=left-attach0/property @@ -274,7 +275,7 @@ property name=sensitiveTrue/property property name=can_focusTrue/property property name=eventsGDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK/property -property name=label translatable=yes_Change the background /property +property name=label translatable=yesChange the _background /property property name=tooltip-text translatable=yesAutomatically select a different background from the current directory./property property name=use_underlineTrue/property property name=draw_indicatorTrue/property @@ -326,7 +327,7 @@ property name=label translatable=yes_Random Order/property property name=use_underlineTrue/property property name=draw_indicatorTrue
[Xfce4-commits] xfdesktop:master Post release tag bump.
Updating branch refs/heads/master to b4563b682d3c4bcf9e4dc9b99c5c6727efc5e4da (commit) from 6e59a0b84939f9f356224ead59b1c3963084a21a (commit) commit b4563b682d3c4bcf9e4dc9b99c5c6727efc5e4da Author: Eric Koegel eric.koe...@gmail.com Date: Sat Nov 2 09:04:14 2013 +0300 Post release tag bump. configure.ac.in |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac.in b/configure.ac.in index c6ba10b..ca310f2 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -9,7 +9,7 @@ m4_define([xfdesktop_version_minor], [11]) m4_define([xfdesktop_version_micro], [1]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[]) +m4_define([xfdesktop_version_tag],[git]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Don't cache the pixbufs in single workspace mode
Updating branch refs/heads/master to 160cb351381664faac01a0506d91fa46559e2bb6 (commit) from cec316ea5c7c4d241cabd778aed3bfcd8299ea95 (commit) commit 160cb351381664faac01a0506d91fa46559e2bb6 Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 1 10:41:48 2013 +0300 Don't cache the pixbufs in single workspace mode While in single workspace mode there's no reason to cache any of the pixbufs since they won't change. This will lower the amount of memory used by xfdesktop and make the memory footprint similar to previous versions while in single workspace mode. src/xfce-backdrop.c | 54 ++- src/xfce-backdrop.h |4 +++ src/xfce-desktop.c | 47 +-- src/xfce-workspace.c | 87 -- src/xfce-workspace.h |4 +++ 5 files changed, 183 insertions(+), 13 deletions(-) diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index 929c6ee..11b950c 100644 --- a/src/xfce-backdrop.c +++ b/src/xfce-backdrop.c @@ -95,6 +95,7 @@ struct _XfceBackdropPriv GdkPixbuf *pix; XfceBackdropImageData *image_data; +gboolean cache_pixbuf; XfceBackdropColorStyle color_style; GdkColor color1; @@ -1246,6 +1247,47 @@ xfce_backdrop_get_random_order(XfceBackdrop *backdrop) return backdrop-priv-random_backdrop_order; } +/** + * xfce_backdrop_set_cache_pixbuf: + * @backdrop: An #XfceBackdrop. + * @cache_pixbuf: When TRUE XfceBackdrop will keep a reference to the current + *pixbuf until another one is set. + * + * XfceBackdrop can be set to keep a reference to the current backdrop and + * increment the reference count when xfce_backdrop_get_pixbuf is called. + * Setting cache_pixbuf to FALSE will cause xfce_backdrop_get_pixbuf to + * return XfceBackdrop's only reference and free any memory allocated. This + * will use less memory, especially when the backdrop isn't expected to change + * as in single workspace mode. + **/ +void +xfce_backdrop_set_cache_pixbuf(XfceBackdrop *backdrop, + gboolean cache_pixbuf) +{ +g_return_if_fail(XFCE_IS_BACKDROP(backdrop)); + +TRACE(entering); + +if(backdrop-priv-cache_pixbuf == cache_pixbuf) +return; + +backdrop-priv-cache_pixbuf = cache_pixbuf; + +DBG(cache_pixbuf now %s, cache_pixbuf ? TRUE : FALSE); + +/* release any cached pixbuf now to save memory */ +if(!cache_pixbuf) +xfce_backdrop_clear_cached_image(backdrop); +} + +gboolean +xfce_backdrop_get_cache_pixbuf(XfceBackdrop *backdrop) +{ +g_return_val_if_fail(XFCE_IS_BACKDROP(backdrop), FALSE); + +return backdrop-priv-cache_pixbuf; +} + /* Generates the background that will either be displayed or will have the * image drawn on top of */ static GdkPixbuf * @@ -1317,9 +1359,19 @@ xfce_backdrop_get_pixbuf(XfceBackdrop *backdrop) { TRACE(entering); -if(backdrop-priv-pix) +if(backdrop-priv-pix backdrop-priv-cache_pixbuf) { +/* return a reference so we can cache it */ return g_object_ref(backdrop-priv-pix); +} else if(backdrop-priv-pix) { +/* We're not going to cache it so return our reference and set our + * pointer to NULL */ +GdkPixbuf *pix = backdrop-priv-pix; +backdrop-priv-pix = NULL; + +return pix; +} +/* !backdrop-priv-pix, call xfce_backdrop_generate_async */ return NULL; } diff --git a/src/xfce-backdrop.h b/src/xfce-backdrop.h index 85707ae..3077a75 100644 --- a/src/xfce-backdrop.h +++ b/src/xfce-backdrop.h @@ -143,6 +143,10 @@ void xfce_backdrop_set_random_order (XfceBackdrop *backdrop, gboolean random_order); gboolean xfce_backdrop_get_random_order (XfceBackdrop *backdrop); +void xfce_backdrop_set_cache_pixbuf (XfceBackdrop *backdrop, + gboolean cache_pixbuf); +gboolean xfce_backdrop_get_cache_pixbuf (XfceBackdrop *backdrop); + GdkPixbuf *xfce_backdrop_get_pixbuf (XfceBackdrop *backdrop); void xfce_backdrop_generate_async(XfceBackdrop *backdrop); diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 4963851..e874a20 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -377,13 +377,6 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data) if(desktop-priv-updates_frozen || !gtk_widget_get_realized(GTK_WIDGET(desktop))) return; -if(!GDK_IS_PIXMAP(pmap)) { -pmap = create_bg_pixmap(gscreen, desktop); - -if(!GDK_IS_PIXMAP(pmap)) -return; -} - TRACE(really entering); current_workspace = xfce_desktop_get_current_workspace(desktop); @@ -479,9 +472,27 @@ backdrop_changed_cb(XfceBackdrop *backdrop, gpointer user_data) /* create the backdrop if needed */ if(!pix) { xfce_backdrop_generate_async(backdrop); + +if(clip_region != NULL
[Xfce4-commits] xfdesktop:master Fix icon moves and deletions
Updating branch refs/heads/master to 20c79bb1e8b1ee2d818d5717688ce54772f85fbe (commit) from 160cb351381664faac01a0506d91fa46559e2bb6 (commit) commit 20c79bb1e8b1ee2d818d5717688ce54772f85fbe Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 1 11:44:43 2013 +0300 Fix icon moves and deletions When creating a temporary file and renaming it, sometimes the icon wouldn't appear on the desktop because the file's info was NULL. This patch fixes how moves and deletions are handled to fix that. Additionally we monitor the changes done event rather than just the change event to prevent flickering icons when large files are moved or downloaded to the desktop. src/xfdesktop-file-icon-manager.c | 68 + 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 727fa6d..af6b93b 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -2464,8 +2464,6 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, DBG(got a moved event); icon = g_hash_table_lookup(fmanager-priv-icons, file); -if(!icon) -return; file_info = g_file_query_info(other_file, XFDESKTOP_FILE_INFO_NAMESPACE, G_FILE_QUERY_INFO_NONE, NULL, NULL); @@ -2473,14 +2471,16 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, if(file_info) { gboolean is_hidden; -/* Get the old position so we can use it for the new icon */ -xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col); +if(icon) { +/* Get the old position so we can use it for the new icon */ +xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), row, col); -/* Remove the icon from the icon_view and this manager's - * hash table */ -xfdesktop_icon_view_remove_item(fmanager-priv-icon_view, -XFDESKTOP_ICON(icon)); -g_hash_table_remove(fmanager-priv-icons, file); +/* Remove the icon from the icon_view and this manager's + * hash table */ +xfdesktop_icon_view_remove_item(fmanager-priv-icon_view, +XFDESKTOP_ICON(icon)); +g_hash_table_remove(fmanager-priv-icons, file); +} is_hidden = g_file_info_get_attribute_boolean(file_info, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN); @@ -2492,21 +2492,22 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, row, col, FALSE); -xfdesktop_file_icon_position_changed(icon, fmanager); +if(icon) +xfdesktop_file_icon_position_changed(icon, fmanager); } g_object_unref(file_info); } break; case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: -case G_FILE_MONITOR_EVENT_CHANGED: +case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: DBG(got changed event); - + icon = g_hash_table_lookup(fmanager-priv-icons, file); if(icon) { file_info = g_file_query_info(file, XFDESKTOP_FILE_INFO_NAMESPACE, G_FILE_QUERY_INFO_NONE, NULL, NULL); - + if(file_info) { /* update the icon if the file still exists */ xfdesktop_file_icon_update_file_info(icon, file_info); @@ -2549,32 +2550,39 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor, g_object_unref(file_info); } - break; case G_FILE_MONITOR_EVENT_DELETED: DBG(got deleted event); filename = g_file_get_path(file); -/* If the file still exists, then keep it. Firefox does this when - * downloading files (deletes the main fail and moves the .part - * file to the main file). */ -if(g_file_test(filename, G_FILE_TEST_EXISTS)) { -DBG(file still exists, not deleting); -g_free(filename); -return; -} - icon = g_hash_table_lookup(fmanager-priv-icons, file); if(icon) { -/* Always try to remove thumbnail so it doesn't take up - * space on the user's disk
[Xfce4-commits] xfdesktop:master Wrong g_return_if_fail macro used
Updating branch refs/heads/master to 7a001c2de7440da2d0a65a5462134a36f5a1ee3e (commit) from 20c79bb1e8b1ee2d818d5717688ce54772f85fbe (commit) commit 7a001c2de7440da2d0a65a5462134a36f5a1ee3e Author: Eric Koegel eric.koe...@gmail.com Date: Fri Nov 1 15:41:58 2013 +0300 Wrong g_return_if_fail macro used src/xfdesktop-file-icon-manager.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index af6b93b..859f8c0 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -1223,7 +1223,7 @@ xfdesktop_file_icon_menu_fill_template_menu(GtkWidget *menu, gchar *label, *dot; guint items = 0; -g_return_val_if_fail(G_IS_FILE(template_dir), FALSE); +g_return_if_fail(G_IS_FILE(template_dir)); enumerator = g_file_enumerate_children(template_dir, XFDESKTOP_FILE_INFO_NAMESPACE, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop|xfdesktop-4.11.1 Creating annotated tag xfdesktop-4.11.1
Updating annotated tag refs/tags/xfdesktop-4.11.1 as new annotated tag to d8bcd6c17ce99c2ed1d0f1267b5c4df655245c42 (tag) succeeds xfdesktop-4.11.0-60-g52cfc66 tagged by Eric Koegel eric.koe...@gmail.com on 2013-11-02 06:44 +0100 Eric Koegel (1): Updates for release. ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Updates for release.
Updating branch refs/heads/master to 784f97d3a70372996ba28a160ea87e95861dab6f (commit) from 52cfc6671c7f495cd3309901b62b3ea57f5f8ced (commit) commit 784f97d3a70372996ba28a160ea87e95861dab6f Author: Eric Koegel eric.koe...@gmail.com Date: Sat Nov 2 08:43:53 2013 +0300 Updates for release. NEWS| 32 configure.ac.in |2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b45d5b4..4dbfc8f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,35 @@ +4.11.1 +== +- Wrong g_return_if_fail macro used +- Fix icon moves and deletions +- Don't cache the pixbufs in single workspace mode +- Clear all pixels from drag highlight box (Bug 10450) +- Speed up template sub-menu loading code (Bug 7834) +- Always move files from the trash (Bug 3983) +- Fix template sub-menu loading code (Bug 10138) +- Fix menu popups via the command line +- Use the Path key of desktop files if a path is not set (Bug #8741) +- Correctly display settings defaults +- Fix some memory leaks +- Include the chronological option in the combobox +- Allow the font size to go to 0. +- Tooltip options in xfdesktop-settings +- Add a chronological backdrop cycle option +- Additonal backdrop cycle options +- More removable device icon types (Bug 4056) +- Add icons in an idle callback +- Right click issues persist (Bug 9323) +- Migrate backdrop settings from previous versions (Bug 10380) +- Set warnings as fatal +- Update manpage (Bug 7576) +- Allow renaming of multiple icons +- Translation updates: Arabic (ar), Bulgarian (bg), Chinese (China) (zh_CN), + Chinese (Taiwan) (zh_TW), Dutch (Flemish) (nl), English (Australia) (en_AU), + French (fr), Hungarian (hu), Icelandic (is), Italian (it), Kazakh (kk), + Korean (ko), Polish (pl), Portuguese (pt), Portuguese (Brazilian) (pt_BR), + Russian (ru), Serbian (sr), Spanish (Castilian) (es), Thai (th), + Turkish (tr), Ukrainian (uk), and Uzbek (uz) + 4.11.0 == - No need to remove the thumbnail if we're removing the icon diff --git a/configure.ac.in b/configure.ac.in index 8f0a05b..621cce8 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -9,7 +9,7 @@ m4_define([xfdesktop_version_minor], [11]) m4_define([xfdesktop_version_micro], [0]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[git]) +m4_define([xfdesktop_version_tag],[]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Revert Updates for release.
Updating branch refs/heads/master to 6b4f14c9535e58fe2e7edabfa67902224bbdfad4 (commit) from 784f97d3a70372996ba28a160ea87e95861dab6f (commit) commit 6b4f14c9535e58fe2e7edabfa67902224bbdfad4 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Nov 2 08:52:30 2013 +0300 Revert Updates for release. Failed to update xfdesktop_version_micro This reverts commit 784f97d3a70372996ba28a160ea87e95861dab6f. NEWS| 32 configure.ac.in |2 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/NEWS b/NEWS index 4dbfc8f..b45d5b4 100644 --- a/NEWS +++ b/NEWS @@ -1,35 +1,3 @@ -4.11.1 -== -- Wrong g_return_if_fail macro used -- Fix icon moves and deletions -- Don't cache the pixbufs in single workspace mode -- Clear all pixels from drag highlight box (Bug 10450) -- Speed up template sub-menu loading code (Bug 7834) -- Always move files from the trash (Bug 3983) -- Fix template sub-menu loading code (Bug 10138) -- Fix menu popups via the command line -- Use the Path key of desktop files if a path is not set (Bug #8741) -- Correctly display settings defaults -- Fix some memory leaks -- Include the chronological option in the combobox -- Allow the font size to go to 0. -- Tooltip options in xfdesktop-settings -- Add a chronological backdrop cycle option -- Additonal backdrop cycle options -- More removable device icon types (Bug 4056) -- Add icons in an idle callback -- Right click issues persist (Bug 9323) -- Migrate backdrop settings from previous versions (Bug 10380) -- Set warnings as fatal -- Update manpage (Bug 7576) -- Allow renaming of multiple icons -- Translation updates: Arabic (ar), Bulgarian (bg), Chinese (China) (zh_CN), - Chinese (Taiwan) (zh_TW), Dutch (Flemish) (nl), English (Australia) (en_AU), - French (fr), Hungarian (hu), Icelandic (is), Italian (it), Kazakh (kk), - Korean (ko), Polish (pl), Portuguese (pt), Portuguese (Brazilian) (pt_BR), - Russian (ru), Serbian (sr), Spanish (Castilian) (es), Thai (th), - Turkish (tr), Ukrainian (uk), and Uzbek (uz) - 4.11.0 == - No need to remove the thumbnail if we're removing the icon diff --git a/configure.ac.in b/configure.ac.in index 621cce8..8f0a05b 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -9,7 +9,7 @@ m4_define([xfdesktop_version_minor], [11]) m4_define([xfdesktop_version_micro], [0]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[]) +m4_define([xfdesktop_version_tag],[git]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Updates for release.
Updating branch refs/heads/master to 6e59a0b84939f9f356224ead59b1c3963084a21a (commit) from 6b4f14c9535e58fe2e7edabfa67902224bbdfad4 (commit) commit 6e59a0b84939f9f356224ead59b1c3963084a21a Author: Eric Koegel eric.koe...@gmail.com Date: Sat Nov 2 08:55:37 2013 +0300 Updates for release. NEWS| 32 configure.ac.in |4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index b45d5b4..4dbfc8f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,35 @@ +4.11.1 +== +- Wrong g_return_if_fail macro used +- Fix icon moves and deletions +- Don't cache the pixbufs in single workspace mode +- Clear all pixels from drag highlight box (Bug 10450) +- Speed up template sub-menu loading code (Bug 7834) +- Always move files from the trash (Bug 3983) +- Fix template sub-menu loading code (Bug 10138) +- Fix menu popups via the command line +- Use the Path key of desktop files if a path is not set (Bug #8741) +- Correctly display settings defaults +- Fix some memory leaks +- Include the chronological option in the combobox +- Allow the font size to go to 0. +- Tooltip options in xfdesktop-settings +- Add a chronological backdrop cycle option +- Additonal backdrop cycle options +- More removable device icon types (Bug 4056) +- Add icons in an idle callback +- Right click issues persist (Bug 9323) +- Migrate backdrop settings from previous versions (Bug 10380) +- Set warnings as fatal +- Update manpage (Bug 7576) +- Allow renaming of multiple icons +- Translation updates: Arabic (ar), Bulgarian (bg), Chinese (China) (zh_CN), + Chinese (Taiwan) (zh_TW), Dutch (Flemish) (nl), English (Australia) (en_AU), + French (fr), Hungarian (hu), Icelandic (is), Italian (it), Kazakh (kk), + Korean (ko), Polish (pl), Portuguese (pt), Portuguese (Brazilian) (pt_BR), + Russian (ru), Serbian (sr), Spanish (Castilian) (es), Thai (th), + Turkish (tr), Ukrainian (uk), and Uzbek (uz) + 4.11.0 == - No need to remove the thumbnail if we're removing the icon diff --git a/configure.ac.in b/configure.ac.in index 8f0a05b..c6ba10b 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -6,10 +6,10 @@ dnl dnl version info m4_define([xfdesktop_version_major], [4]) m4_define([xfdesktop_version_minor], [11]) -m4_define([xfdesktop_version_micro], [0]) +m4_define([xfdesktop_version_micro], [1]) m4_define([xfdesktop_version_nano], []) m4_define([xfdesktop_version_build], [@REVISION@]) -m4_define([xfdesktop_version_tag],[git]) +m4_define([xfdesktop_version_tag],[]) m4_define([xfdesktop_version], [xfdesktop_version_major().xfdesktop_version_minor().xfdesktop_version_micro()ifelse(xfdesktop_version_nano(), [], [], [.xfdesktop_version_nano()])ifelse(xfdesktop_version_tag(), [git], [xfdesktop_version_tag()-xfdesktop_version_build()], [xfdesktop_version_tag()])]) dnl minimum required versions ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Speed up template sub-menu loading code (Bug 7834)
Updating branch refs/heads/master to 4e5cd1813862800c5d768d5ef59279b37adbdfc1 (commit) from 312098a1d9ba81cc588d7d121587c14e35728eed (commit) commit 4e5cd1813862800c5d768d5ef59279b37adbdfc1 Author: Eric Koegel eric.koe...@gmail.com Date: Wed Oct 30 20:05:07 2013 +0300 Speed up template sub-menu loading code (Bug 7834) This patch will make it so that xfdesktop won't walk the entire directory and throw away most of the results when there's more than max-templates present. Instead it only gathers up until max-templates then displays those files. This should help when the XDG_TEMPLATES_DIR has a lot of files in it. src/xfdesktop-file-icon-manager.c | 91 +++-- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 7b6a8d8..727fa6d 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -1209,7 +1209,7 @@ compare_template_files(gconstpointer a, } } -static gboolean +static void xfdesktop_file_icon_menu_fill_template_menu(GtkWidget *menu, GFile *template_dir, XfdesktopFileIconManager *fmanager) @@ -1221,7 +1221,6 @@ xfdesktop_file_icon_menu_fill_template_menu(GtkWidget *menu, GIcon *icon; GList *files = NULL, *lp; gchar *label, *dot; -gboolean have_templates = FALSE; guint items = 0; g_return_val_if_fail(G_IS_FILE(template_dir), FALSE); @@ -1231,67 +1230,73 @@ xfdesktop_file_icon_menu_fill_template_menu(GtkWidget *menu, G_FILE_QUERY_INFO_NONE, NULL, NULL); -if(enumerator) { -while((info = g_file_enumerator_next_file(enumerator, NULL, NULL))) { -file = g_file_get_child(template_dir, g_file_info_get_name(info)); -g_object_set_data_full(G_OBJECT(file), info, info, g_object_unref); -files = g_list_prepend(files, file); +if(enumerator == NULL) +return; + +/* keep it under fmanager-priv-max_templates otherwise the menu + * could have tons of items and be unusable. Additionally this should + * help in instances where the XDG_TEMPLATES_DIR has a large number of + * files in it. */ +while((info = g_file_enumerator_next_file(enumerator, NULL, NULL)) items fmanager-priv-max_templates) { +/* Skip directories */ +if(g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) { + g_object_unref(info); + continue; } -g_object_unref(enumerator); +/* skip hidden backup files */ +if(g_file_info_get_is_hidden(info) || g_file_info_get_is_backup(info)) { +g_object_unref(info); +continue; +} + +file = g_file_get_child(template_dir, g_file_info_get_name(info)); +g_object_set_data_full(G_OBJECT(file), info, info, g_object_unref); +files = g_list_prepend(files, file); + +items++; } +g_object_unref(enumerator); + files = g_list_sort(files, compare_template_files); -for(lp = files; lp != NULL items fmanager-priv-max_templates; lp = lp-next) { +for(lp = files; lp != NULL; lp = lp-next) { file = lp-data; info = g_object_get_data(G_OBJECT(file), info); -/* Skip directories */ -if(g_file_info_get_file_type(info) != G_FILE_TYPE_DIRECTORY) { -/* skip hidden backup files */ -if(g_file_info_get_is_hidden(info) || g_file_info_get_is_backup(info)) { -g_object_unref(file); -continue; -} - -/* generate a label by stripping off the extension */ -label = g_strdup(g_file_info_get_display_name(info)); -dot = g_utf8_strrchr(label, -1, '.'); -if(dot) -*dot = '\0'; +/* generate a label by stripping off the extension */ +label = g_strdup(g_file_info_get_display_name(info)); +dot = g_utf8_strrchr(label, -1, '.'); +if(dot) +*dot = '\0'; -/* allocate a new menu item */ -item = gtk_image_menu_item_new_with_label(label); - -/* determine the icon to display */ -icon = g_file_info_get_icon(info); -image = gtk_image_new_from_gicon(icon, GTK_ICON_SIZE_MENU); -gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image); +/* allocate a new menu item */ +item = gtk_image_menu_item_new_with_label(label); +g_free(label); -/* add the item to the menu */ -gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); -gtk_widget_show(item); +/* determine the icon to display */ +icon = g_file_info_get_icon(info); +image = gtk_image_new_from_gicon(icon
[Xfce4-commits] xfdesktop:master Always move files from the trash (Bug 3983)
Updating branch refs/heads/master to 312098a1d9ba81cc588d7d121587c14e35728eed (commit) from 5eb24adb0f1ca7ef072552d83fdc04bb8044f96b (commit) commit 312098a1d9ba81cc588d7d121587c14e35728eed Author: Eric Koegel eric.koe...@gmail.com Date: Mon Oct 28 14:21:38 2013 +0300 Always move files from the trash (Bug 3983) src/xfdesktop-file-icon-manager.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index a4432cb..7b6a8d8 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -3527,6 +3527,12 @@ xfdesktop_file_icon_manager_propose_drop_action(XfdesktopIconViewManager *manage if(file_list) { GFile *base_dest_file = NULL; +/* always move files from the trash */ +if(g_file_has_uri_scheme(file_list-data, trash)) { +xfdesktop_file_utils_file_list_free(file_list); +return GDK_ACTION_MOVE; +} + /* source must be local file */ if(!g_file_has_uri_scheme(file_list-data, file)) { xfdesktop_file_utils_file_list_free(file_list); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Clear all pixels from drag highlight box (Bug 10450)
Updating branch refs/heads/master to 74797c73ab513258d796f77edb2908a0fba16bb3 (commit) from 4e5cd1813862800c5d768d5ef59279b37adbdfc1 (commit) commit 74797c73ab513258d796f77edb2908a0fba16bb3 Author: Eric Koegel eric.koe...@gmail.com Date: Thu Oct 31 20:49:40 2013 +0300 Clear all pixels from drag highlight box (Bug 10450) Increase the length of the lines used to clear the drawing area in xfdesktop_icon_view_clear_drag_highlight. This way there's no artifacts left when the highlight box is supposed to be removed. src/xfdesktop-icon-view.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index 345b400..f28e36a 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -1415,25 +1415,32 @@ xfdesktop_icon_view_clear_drag_highlight(XfdesktopIconView *icon_view, if(0 == cell_highlight-width || 0 == cell_highlight-height) return; +/* When dragging an icon a box is drawn to indicate the cell where the + * icon could be moved to if dropped. We need to clear that box but make + * the length of the lines slightly longer to clear all the pixels */ +/* Left vertical line */ gtk_widget_queue_draw_area(GTK_WIDGET(icon_view), cell_highlight-x - 1, - cell_highlight-y, + cell_highlight-y - 1, 2, - cell_highlight-height); + cell_highlight-height + 2); +/* Right vertical line */ gtk_widget_queue_draw_area(GTK_WIDGET(icon_view), cell_highlight-x + cell_highlight-width - 1, cell_highlight-y, 2, - cell_highlight-height); + cell_highlight-height + 2); +/* Top horizontal line */ gtk_widget_queue_draw_area(GTK_WIDGET(icon_view), cell_highlight-x, cell_highlight-y - 1, - cell_highlight-width, + cell_highlight-width + 2, 2); +/* Bottom horizontal line */ gtk_widget_queue_draw_area(GTK_WIDGET(icon_view), cell_highlight-x, cell_highlight-y + cell_highlight-height - 1, - cell_highlight-width, + cell_highlight-width + 2, 2); cell_highlight-width = cell_highlight-height = 0; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix menu popups via the command line
Updating branch refs/heads/master to 82b385d0e243dc26429b8cc647630f18107ebe6a (commit) from 24d5681d0bd57bce021cc1b44995de27c67e5fcc (commit) commit 82b385d0e243dc26429b8cc647630f18107ebe6a Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 13:04:28 2013 +0300 Fix menu popups via the command line common/xfdesktop-common.c | 40 common/xfdesktop-common.h |2 ++ src/xfce-desktop.c| 24 +++- src/xfdesktop-icon-view.c |6 -- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 2011e6c..ca6b89c 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -180,3 +180,43 @@ xfce_translate_image_styles(gint input) return style; } + +/* Code taken from xfwm4/src/menu.c:grab_available(). This should fix the case + * where binding 'xfdesktop -menu' to a keyboard shortcut sometimes works and + * sometimes doesn't. Credit for this one goes to Olivier. + * Returns the grab time if successful, 0 on failure. + */ +guint32 +xfdesktop_popup_keyboard_grab_available(GdkWindow *win) +{ +GdkGrabStatus grab; +gboolean grab_failed = FALSE; +guint32 timestamp; +gint i = 0; + +TRACE(entering); + +timestamp = gtk_get_current_event_time(); + +grab = gdk_keyboard_grab(win, TRUE, timestamp); + +while((i++ 2500) (grab_failed = ((grab != GDK_GRAB_SUCCESS +{ +TRACE (keyboard grab not available yet, reason: %d, waiting... (%i), grab, i); +if(grab == GDK_GRAB_INVALID_TIME) +break; + +g_usleep (100); +if(grab != GDK_GRAB_SUCCESS) { +grab = gdk_keyboard_grab(win, TRUE, timestamp); +} +} + +if (grab == GDK_GRAB_SUCCESS) { +gdk_keyboard_ungrab(timestamp); +} else { +timestamp = 0; +} + +return timestamp; +} diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index dde3fa40..3377461 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -94,6 +94,8 @@ void xfdesktop_send_client_message(Window xid, const gchar *msg); gint xfce_translate_image_styles(gint input); +guint32 xfdesktop_popup_keyboard_grab_available(GdkWindow *win); + G_END_DECLS #endif diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index d59a92a..4963851 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -862,7 +862,10 @@ xfce_desktop_init(XfceDesktop *desktop) XfceDesktopPriv); gtk_window_set_type_hint(GTK_WINDOW(desktop), GDK_WINDOW_TYPE_HINT_DESKTOP); -gtk_window_set_accept_focus(GTK_WINDOW(desktop), FALSE); +/* Accept focus is needed for the menu pop up either by the menu key on + * the keyboard or Shift+F10. */ +gtk_window_set_accept_focus(GTK_WINDOW(desktop), TRUE); +/* Can focus is needed for the gtk_grab_add/remove commands */ gtk_widget_set_can_focus(GTK_WIDGET(desktop), TRUE); gtk_window_set_resizable(GTK_WINDOW(desktop), FALSE); } @@ -1590,9 +1593,7 @@ xfce_desktop_do_menu_popup(XfceDesktop *desktop, if(activate_time == 0) activate_time = gtk_get_current_event_time(); -/* bug #3652: for some reason passing the correct button here breaks - * on some systems but not others. always pass 0 for now. */ -gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, activate_time); +gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, activate_time); } void @@ -1600,16 +1601,16 @@ xfce_desktop_popup_root_menu(XfceDesktop *desktop, guint button, guint activate_time) { +TRACE(entering); + /* If it's launched by xfdesktop --menu we won't have an event time. - * Just grab the focus so the menu can pop up */ + * Grab the keyboard focus */ if(activate_time == 0) -gtk_grab_add(GTK_WIDGET(desktop)); +activate_time = xfdesktop_popup_keyboard_grab_available(gtk_widget_get_window(GTK_WIDGET(desktop))); xfce_desktop_do_menu_popup(desktop, button, activate_time, signals[SIG_POPULATE_ROOT_MENU]); -if(activate_time == 0) -gtk_grab_remove(GTK_WIDGET(desktop)); } void @@ -1618,15 +1619,12 @@ xfce_desktop_popup_secondary_root_menu(XfceDesktop *desktop, guint activate_time) { /* If it's launched by xfdesktop --windowlist we won't have an event time. - * Just grab the focus so the menu can pop up */ + * Grab the keyboard focus */ if(activate_time == 0) -gtk_grab_add(GTK_WIDGET(desktop)); +activate_time = xfdesktop_popup_keyboard_grab_available(gtk_widget_get_window(GTK_WIDGET(desktop))); xfce_desktop_do_menu_popup(desktop, button, activate_time, signals[SIG_POPULATE_SECONDARY_ROOT_MENU
[Xfce4-commits] xfdesktop:master Fix template sub-menu loading code (Bug 10138)
Updating branch refs/heads/master to 11b1396b120e4719abf19ae37589a73f900b3ff7 (commit) from 82b385d0e243dc26429b8cc647630f18107ebe6a (commit) commit 11b1396b120e4719abf19ae37589a73f900b3ff7 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Oct 28 16:38:30 2013 +0300 Fix template sub-menu loading code (Bug 10138) The old code recursively searched the XDG_TEMPLATES_DIR for files that can be used as templates. This patch changes it so that it only searches that directory and limits the number of items shown to the xfconf property max-template-files which is set to 16 to keep the sub-menu usable. It also only shows files which are not marked as hidden or backup to eliminate clutter. common/xfdesktop-common.h |1 + src/xfdesktop-file-icon-manager.c | 289 - 2 files changed, 161 insertions(+), 129 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 3377461..e1b3878 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -61,6 +61,7 @@ #define DESKTOP_ICONS_SHOW_TRASH /desktop-icons/file-icons/show-trash #define DESKTOP_ICONS_SHOW_FILESYSTEM /desktop-icons/file-icons/show-filesystem #define DESKTOP_ICONS_SHOW_REMOVABLE /desktop-icons/file-icons/show-removable +#define DESKTOP_ICONS_MAX_TEMPLATE_FILES /desktop-icons/file-icons/max-template-files /** * File information namespaces queried for #GFileInfo objects. diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 63d00c4..a4432cb 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -76,8 +76,8 @@ #include libxfce4util/libxfce4util.h #include libxfce4ui/libxfce4ui.h -#define SAVE_DELAY 7000 -#define BORDER 8 +#define SAVE_DELAY 7000 +#define BORDER 8 typedef enum { @@ -90,7 +90,8 @@ typedef enum PROP_SHOW_NETWORK_VOLUME, PROP_SHOW_DEVICE_VOLUME, PROP_SHOW_UNKNOWN_VOLUME, -PROP_SHOW_THUMBNAILS +PROP_SHOW_THUMBNAILS, +PROP_MAX_TEMPLATES, } XfdesktopFileIconManagerProp; struct _XfdesktopFileIconManagerPrivate @@ -139,6 +140,8 @@ struct _XfdesktopFileIconManagerPrivate #endif XfdesktopThumbnailer *thumbnailer; + +guint max_templates; }; static void xfdesktop_file_icon_manager_set_property(GObject *object, @@ -206,6 +209,11 @@ static void xfdesktop_file_icon_manager_update_image(GtkWidget *widget, gchar *thumbfile, XfdesktopFileIconManager *fmanager); +static void +xfdesktop_file_icon_manager_set_max_templates(XfdesktopFileIconManager *manager, + gint max_templates); + + G_DEFINE_TYPE_EXTENDED(XfdesktopFileIconManager, xfdesktop_file_icon_manager, G_TYPE_OBJECT, 0, @@ -318,6 +326,12 @@ xfdesktop_file_icon_manager_class_init(XfdesktopFileIconManagerClass *klass) show-thumbnails, TRUE, XFDESKTOP_PARAM_FLAGS)); +g_object_class_install_property(gobject_class, PROP_MAX_TEMPLATES, +g_param_spec_uint(max-templates, + max-templates, + max-templates, + 0, G_MAXUSHORT, 16, + XFDESKTOP_PARAM_FLAGS)); #undef XFDESKTOP_PARAM_FLAGS xfdesktop_app_info_quark = g_quark_from_static_string(xfdesktop-app-info-quark); @@ -388,6 +402,11 @@ xfdesktop_file_icon_manager_set_property(GObject *object, g_value_get_boolean(value)); break; +case PROP_MAX_TEMPLATES: +xfdesktop_file_icon_manager_set_max_templates(fmanager, + g_value_get_uint(value)); +break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); } @@ -440,7 +459,11 @@ xfdesktop_file_icon_manager_get_property(GObject *object, case PROP_SHOW_THUMBNAILS: g_value_set_boolean(value, fmanager-priv-show_thumbnails); break; - + +case PROP_MAX_TEMPLATES: +g_value_set_int(value, fmanager-priv-max_templates); +break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); } @@ -1166,24 +1189,24 @@ static gint compare_template_files(gconstpointer a, gconstpointer b) { - GFileInfo *info_a = g_object_get_data(G_OBJECT(a), info
[Xfce4-commits] xfdesktop:master Use the Path key of desktop files if a path is not set (Bug #8741)
Updating branch refs/heads/master to 8f89ae4bb60fe6b15e0a8eb5b31135fbdd6ca182 (commit) from 3deb28c2b6f26951a556b1e46d69591c8f6c6299 (commit) commit 8f89ae4bb60fe6b15e0a8eb5b31135fbdd6ca182 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Apr 28 14:05:12 2012 +0300 Use the Path key of desktop files if a path is not set (Bug #8741) src/xfdesktop-file-utils.c | 25 + 1 file changed, 25 insertions(+) diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c index 4f53c57..94df3a2 100644 --- a/src/xfdesktop-file-utils.c +++ b/src/xfdesktop-file-utils.c @@ -1117,6 +1117,31 @@ xfdesktop_file_utils_execute(GFile *working_directory, uris[n] = g_file_get_uri(lp-data); uris[n] = NULL; +/* If the working_dir wasn't set check if this is a .desktop file + * we can parse a working dir from */ +if(working_dir == NULL) { +GFileInfo *info = g_file_query_info(file, +XFDESKTOP_FILE_INFO_NAMESPACE, +G_FILE_QUERY_INFO_NONE, +NULL, NULL); + +if(xfdesktop_file_utils_is_desktop_file(info)) { +XfceRc *rc; +gchar *path = g_file_get_path(file); +if(path != NULL) { +rc = xfce_rc_simple_open(path, TRUE); +if(rc != NULL) { +working_dir = g_strdup(xfce_rc_read_entry(rc, Path, NULL)); +xfce_rc_close(rc); +} +g_free(path); +} +} + +if(info) +g_object_unref(info); +} + if(!xfdesktop_file_manager_proxy_execute(fileman_proxy, working_dir, uri, (const gchar **)uris, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:eric/settings-changes Correctly display settings defaults
Updating branch refs/heads/eric/settings-changes to ee9c70df22b26648ec734e84181f4bf27a892aec (commit) from 2f9278f47973b337f52619afece20cf498664fd6 (commit) commit ee9c70df22b26648ec734e84181f4bf27a892aec Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 10:38:54 2013 +0300 Correctly display settings defaults When changing workspaces or monitors in the settings app, make sure we fall back to xfdesktop's defaults when nothing else has been configured. settings/main.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/settings/main.c b/settings/main.c index b63ee3c..86d4bbd 100644 --- a/settings/main.c +++ b/settings/main.c @@ -1047,6 +1047,7 @@ cb_folder_selection_changed(GtkWidget *button, DBG(filename %s, previous_filename %s. Nothing changed, filename == NULL ? NULL : filename, previous_filename == NULL ? NULL : previous_filename); + g_free(filename); g_free(previous_filename); return; @@ -1164,7 +1165,9 @@ xfdesktop_settings_update_iconview_folder(AppearancePanel *panel) } /* This function is to add or remove all the bindings for the background - * tab. It's intended to be used when the app changes monitors or workspaces */ + * tab. It's intended to be used when the app changes monitors or workspaces. + * It reverts the items back to their defaults before binding any new settings + * that way if the setting isn't present, the default correctly displays. */ static void xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gboolean remove_binding) @@ -1248,6 +1251,13 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), g_value_get_boxed(value)); g_value_unset(value); +} else { +/* revert to showing our default color */ +GdkColor color1; +color1.red = 0x1515; +color1.green = 0x; +color1.blue = 0x; + gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), color1); } g_free(old_property); @@ -1276,6 +1286,13 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), g_value_get_boxed(value)); g_value_unset(value); +} else { +/* revert to showing our default color */ +GdkColor color2; +color2.red = 0x1515; +color2.green = 0x; +color2.blue = 0x; + gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color2_btn), color2); } g_free(old_property); @@ -1294,6 +1311,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-backdrop_cycle_chkbox), active); } else { +/* The default is disable cycling, set that before we bind to anything */ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-backdrop_cycle_chkbox), FALSE); + xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN, G_OBJECT(panel-backdrop_cycle_chkbox), active); } @@ -1305,6 +1325,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-combo_backdrop_cycle_period), active); } else { +/* default is minutes, set that before we bind to it */ + gtk_combo_box_set_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period), XFCE_BACKDROP_PERIOD_MINUES); + xfconf_g_property_bind(channel, buf, G_TYPE_INT, G_OBJECT(panel-combo_backdrop_cycle_period), active); /* determine if the cycle timer spin box is sensitive */ @@ -1335,6 +1358,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-random_backdrop_order_chkbox), active); } else { +/* The default is sequential, set that before we bind to anything */ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-random_backdrop_order_chkbox), FALSE); + xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN, G_OBJECT(panel-random_backdrop_order_chkbox), active); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman
[Xfce4-commits] xfdesktop:eric/settings-changes Fix memory leaks in the settings app
Updating branch refs/heads/eric/settings-changes to f6a34c5144f05eaf8327eca02da724353c542dff (commit) from ee9c70df22b26648ec734e84181f4bf27a892aec (commit) commit f6a34c5144f05eaf8327eca02da724353c542dff Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 10:59:48 2013 +0300 Fix memory leaks in the settings app settings/main.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/settings/main.c b/settings/main.c index 86d4bbd..f5d59dd 100644 --- a/settings/main.c +++ b/settings/main.c @@ -305,7 +305,7 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model, GtkTreeIter *iter, AppearancePanel *panel) { -gchar *filename; +gchar *filename = NULL; gtk_tree_model_get(model, iter, COL_FILENAME, filename, -1); @@ -319,6 +319,9 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model, xfdesktop_settings_add_file_to_queue(panel, pdata); } + +if(filename) +g_free(filename); } static void @@ -1430,6 +1433,8 @@ cb_update_background_tab(WnckWindow *wnck_window, if(panel-monitor_name != NULL) g_free(panel-monitor_name); +if(monitor_name != NULL) +g_free(monitor_name); panel-workspace = workspace_num; panel-screen = screen_num; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:eric/settings-changes Fix some memory leaks
Updating branch refs/heads/eric/settings-changes to 2f9278f47973b337f52619afece20cf498664fd6 (commit) from 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit) commit 2f9278f47973b337f52619afece20cf498664fd6 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 09:29:43 2013 +0300 Fix some memory leaks common/xfdesktop-thumbnailer.c| 38 +++- src/xfce-backdrop.c | 39 ++--- src/xfce-desktop.c| 30 src/xfce-workspace.c |2 ++ src/xfdesktop-file-icon-manager.c | 17 +--- 5 files changed, 91 insertions(+), 35 deletions(-) diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c index 2416d8b..248a3c5 100644 --- a/common/xfdesktop-thumbnailer.c +++ b/common/xfdesktop-thumbnailer.c @@ -340,7 +340,7 @@ xfdesktop_thumbnailer_queue_thumbnail(XfdesktopThumbnailer *thumbnailer, if(g_slist_find(thumbnailer-priv-queue, file) == NULL) { thumbnailer-priv-queue = g_slist_prepend(thumbnailer-priv-queue, - file); + g_strdup(file)); } thumbnailer-priv-request_timer_id = g_timeout_add_full( @@ -370,6 +370,8 @@ void xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer, gchar *file) { +GSList *item; + g_return_if_fail(XFDESKTOP_IS_THUMBNAILER(thumbnailer)); g_return_if_fail(file != NULL); @@ -392,9 +394,11 @@ xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer, thumbnailer-priv-handle = 0; } -if(g_slist_find(thumbnailer-priv-queue, file) != NULL) { -thumbnailer-priv-queue = g_slist_remove_all(thumbnailer-priv-queue, - file); +item = g_slist_find(thumbnailer-priv-queue, file); +if(item != NULL) { +g_free(item-data); +thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue, + file); } thumbnailer-priv-request_timer_id = g_timeout_add_full( @@ -436,6 +440,7 @@ xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer) file = g_file_new_for_path(iter-data); uris[i] = g_file_get_uri(file); mimetypes[i] = xfdesktop_get_file_mimetype(iter-data); + g_object_unref(file); } iter = g_slist_next(iter); @@ -465,6 +470,18 @@ xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer) } } +/* Free the memory */ +i = 0; +iter = thumbnailer-priv-queue; +while(iter) { +if(iter-data) { +g_free(uris[i]); +g_free(mimetypes[i]); +} +iter = g_slist_next(iter); +i++; +} + g_free(uris); g_free(mimetypes); @@ -498,7 +515,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, gchar *thumbnail_location; GFile *file; GSList *iter = thumbnailer-priv-queue; -gchar *f_uri, *f_uri_checksum, *filename; +gchar *f_uri, *f_uri_checksum, *filename, *temp; gchar *thumbnail_flavor; gint x = 0; @@ -531,8 +548,8 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, filename, NULL); DBG(thumbnail-ready src: %s thumbnail: %s, -(char*)iter-data, -thumbnail_location); +(char*)iter-data, +thumbnail_location); g_signal_emit(G_OBJECT(thumbnailer), thumbnailer_signals[THUMBNAIL_READY], @@ -540,14 +557,17 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, iter-data, thumbnail_location); +temp = iter-data; thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue, - iter-data); + temp); iter = thumbnailer-priv-queue; x++; - + g_free(filename); g_free(f_uri_checksum); +g_free(thumbnail_location); +g_free(temp); } else { iter = g_slist_next(iter); } diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index 14ce700..929c6ee 100644 --- a/src/xfce-backdrop.c +++ b/src/xfce-backdrop.c @@ -240,29 +240,36 @@ xfce_backdrop_clear_cached_image(XfceBackdrop *backdrop) backdrop-priv-pix = NULL; } +/* Returns a GList of all the files in the parent directory of filename */ static GList * -list_files_in_dir(const gchar *path) +list_files_in_dir(const gchar *filename) { GDir *dir; gboolean needs_slash
[Xfce4-commits] xfdesktop:master Tooltip options in xfdesktop-settings
Updating branch refs/heads/master to 7b305eb5092ce88c32e019d6479903d630b9ae86 (commit) from d12988225513fff7c219df973dd11e18a4670a27 (commit) commit 7b305eb5092ce88c32e019d6479903d630b9ae86 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Oct 21 11:22:16 2013 +0300 Tooltip options in xfdesktop-settings There's now an option to toggle the display of tooltips on the desktop as well as a spinbox to choose the preview image size. The tooltip style is still present and if the user doesn't change the tooltip size then it will fallback to the style setting, and then finally default to the DEFAULT_TOOLTIP_SIZE. settings/main.c | 28 +++-- settings/xfdesktop-settings-ui.glade | 47 +++ src/xfdesktop-icon-view.c| 110 +- 3 files changed, 167 insertions(+), 18 deletions(-) diff --git a/settings/main.c b/settings/main.c index 7122d35..3e92b16 100644 --- a/settings/main.c +++ b/settings/main.c @@ -75,6 +75,8 @@ #define DESKTOP_ICONS_ICON_SIZE_PROP /desktop-icons/icon-size #define DESKTOP_ICONS_FONT_SIZE_PROP /desktop-icons/font-size #define DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP /desktop-icons/use-custom-font-size +#define DESKTOP_ICONS_SHOW_TOOLTIP_PROP /desktop-icons/show-tooltips +#define DESKTOP_ICONS_TOOLTIP_SIZE_PROP /desktop-icons/tooltip-size #define DESKTOP_ICONS_SINGLE_CLICK_PROP /desktop-icons/single-click typedef struct @@ -867,9 +869,11 @@ xfdesktop_settings_get_active_workspace(AppearancePanel *panel, return workspace_num; } +/* This works for both the custom font size and show tooltips check buttons, + * it just enables the associated spin button */ static void -cb_xfdesktop_chk_custom_font_size_toggled(GtkCheckButton *button, - gpointer user_data) +cb_xfdesktop_chk_button_toggled(GtkCheckButton *button, +gpointer user_data) { GtkWidget *spin_button = GTK_WIDGET(user_data); @@ -1599,7 +1603,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, GtkWidget *appearance_container, *chk_custom_font_size, *spin_font_size, *w, *box, *spin_icon_size, *chk_show_thumbnails, *chk_single_click, *appearance_settings, - *bnt_exit; + *chk_show_tooltips, *spin_tooltip_size, *bnt_exit; GtkBuilder *appearance_gxml; AppearancePanel *panel = g_new0(AppearancePanel, 1); GError *error = NULL; @@ -1639,10 +1643,20 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, chk_single_click = GTK_WIDGET(gtk_builder_get_object(main_gxml, chk_single_click)); +/* tooltip options */ +chk_show_tooltips = GTK_WIDGET(gtk_builder_get_object(main_gxml, chk_show_tooltips)); +spin_tooltip_size = GTK_WIDGET(gtk_builder_get_object(main_gxml, spin_tooltip_size)); +gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_tooltip_size), 128); + +/* connect up the signals */ g_signal_connect(G_OBJECT(chk_custom_font_size), toggled, - G_CALLBACK(cb_xfdesktop_chk_custom_font_size_toggled), + G_CALLBACK(cb_xfdesktop_chk_button_toggled), spin_font_size); +g_signal_connect(G_OBJECT(chk_show_tooltips), toggled, + G_CALLBACK(cb_xfdesktop_chk_button_toggled), + spin_tooltip_size); + /* thumbnails */ chk_show_thumbnails = GTK_WIDGET(gtk_builder_get_object(main_gxml, chk_show_thumbnails)); @@ -1836,6 +1850,12 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP, G_TYPE_BOOLEAN, G_OBJECT(chk_custom_font_size), active); +xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TOOLTIP_PROP, + G_TYPE_BOOLEAN, G_OBJECT(chk_show_tooltips), + active); +xfconf_g_property_bind(channel, DESKTOP_ICONS_TOOLTIP_SIZE_PROP, G_TYPE_DOUBLE, + G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_tooltip_size))), + value); xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, G_OBJECT(chk_show_thumbnails), active); diff --git a/settings/xfdesktop-settings-ui.glade b/settings/xfdesktop-settings-ui.glade index b69fe4b..1e72179 100644 --- a/settings/xfdesktop-settings-ui.glade +++ b/settings/xfdesktop-settings-ui.glade @@ -17,6 +17,14 @@ property name=page_size0/property property name=value12/property /object + object class=GtkAdjustment id=adjustment_tooltip +property name=upper256/property +property name
[Xfce4-commits] xfdesktop:master Allow the font size to go to 0.
Updating branch refs/heads/master to 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a (commit) from 7b305eb5092ce88c32e019d6479903d630b9ae86 (commit) commit 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a Author: Eric Koegel eric.koe...@gmail.com Date: Mon Oct 21 11:39:03 2013 +0300 Allow the font size to go to 0. Allow the user to set the font size to 0, at which point no icon label will be drawn. settings/xfdesktop-settings-ui.glade |2 +- src/xfce-desktop.c |7 --- src/xfdesktop-icon-view.c|5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/settings/xfdesktop-settings-ui.glade b/settings/xfdesktop-settings-ui.glade index 1e72179..ff04b37 100644 --- a/settings/xfdesktop-settings-ui.glade +++ b/settings/xfdesktop-settings-ui.glade @@ -11,7 +11,7 @@ /object object class=GtkAdjustment id=adjustment4 property name=upper144/property -property name=lower4/property +property name=lower0/property property name=page_increment10/property property name=step_increment1/property property name=page_size0/property diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index b5b718d..e7d5b45 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -245,9 +245,10 @@ xfce_desktop_setup_icon_view(XfceDesktop *desktop) xfce_desktop_ensure_system_font_size(desktop); desktop-priv-icon_view = xfdesktop_icon_view_new(manager); +/* If the user set a custom font size, use it. Otherwise use the system + * font size */ xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop-priv-icon_view), - (!desktop-priv-icons_font_size_set - || !desktop-priv-icons_font_size) + (!desktop-priv-icons_font_size_set) ? desktop-priv-system_font_size : desktop-priv-icons_font_size); if(desktop-priv-icons_size 0) { @@ -818,7 +819,7 @@ xfce_desktop_class_init(XfceDesktopClass *klass) g_param_spec_uint(icon-font-size, icon font size, icon font size, - 4, 144, 12, + 0, 144, 12, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_FONT_SIZE_SET, diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index dd4a7e4..987c9a7 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -1166,7 +1166,6 @@ xfdesktop_icon_view_show_tooltip(GtkWidget *widget, return FALSE; tooltip_size = xfdesktop_icon_view_get_tooltip_size(icon_view); -DBG(tooltip size %d, tooltip_size); tip_text = xfdesktop_icon_peek_tooltip(icon_view-priv-item_under_pointer); if(!tip_text) @@ -3116,7 +3115,9 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view, } /* Only redraw the text if the text area requires it. */ -if(gdk_rectangle_intersect(area, text_extents, intersection)) { +if(gdk_rectangle_intersect(area, text_extents, intersection) +icon_view-priv-font_size 0) +{ xfdesktop_paint_rounded_box(icon_view, state, text_extents, area); if (state == GTK_STATE_NORMAL) { ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Correctly display settings defaults
Updating branch refs/heads/master to ee9c70df22b26648ec734e84181f4bf27a892aec (commit) from 2f9278f47973b337f52619afece20cf498664fd6 (commit) commit ee9c70df22b26648ec734e84181f4bf27a892aec Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 10:38:54 2013 +0300 Correctly display settings defaults When changing workspaces or monitors in the settings app, make sure we fall back to xfdesktop's defaults when nothing else has been configured. settings/main.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/settings/main.c b/settings/main.c index b63ee3c..86d4bbd 100644 --- a/settings/main.c +++ b/settings/main.c @@ -1047,6 +1047,7 @@ cb_folder_selection_changed(GtkWidget *button, DBG(filename %s, previous_filename %s. Nothing changed, filename == NULL ? NULL : filename, previous_filename == NULL ? NULL : previous_filename); + g_free(filename); g_free(previous_filename); return; @@ -1164,7 +1165,9 @@ xfdesktop_settings_update_iconview_folder(AppearancePanel *panel) } /* This function is to add or remove all the bindings for the background - * tab. It's intended to be used when the app changes monitors or workspaces */ + * tab. It's intended to be used when the app changes monitors or workspaces. + * It reverts the items back to their defaults before binding any new settings + * that way if the setting isn't present, the default correctly displays. */ static void xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gboolean remove_binding) @@ -1248,6 +1251,13 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), g_value_get_boxed(value)); g_value_unset(value); +} else { +/* revert to showing our default color */ +GdkColor color1; +color1.red = 0x1515; +color1.green = 0x; +color1.blue = 0x; + gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), color1); } g_free(old_property); @@ -1276,6 +1286,13 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), g_value_get_boxed(value)); g_value_unset(value); +} else { +/* revert to showing our default color */ +GdkColor color2; +color2.red = 0x1515; +color2.green = 0x; +color2.blue = 0x; + gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color2_btn), color2); } g_free(old_property); @@ -1294,6 +1311,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-backdrop_cycle_chkbox), active); } else { +/* The default is disable cycling, set that before we bind to anything */ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-backdrop_cycle_chkbox), FALSE); + xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN, G_OBJECT(panel-backdrop_cycle_chkbox), active); } @@ -1305,6 +1325,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-combo_backdrop_cycle_period), active); } else { +/* default is minutes, set that before we bind to it */ + gtk_combo_box_set_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period), XFCE_BACKDROP_PERIOD_MINUES); + xfconf_g_property_bind(channel, buf, G_TYPE_INT, G_OBJECT(panel-combo_backdrop_cycle_period), active); /* determine if the cycle timer spin box is sensitive */ @@ -1335,6 +1358,9 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, xfconf_g_property_unbind_by_property(channel, buf, G_OBJECT(panel-random_backdrop_order_chkbox), active); } else { +/* The default is sequential, set that before we bind to anything */ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-random_backdrop_order_chkbox), FALSE); + xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN, G_OBJECT(panel-random_backdrop_order_chkbox), active); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Fix memory leaks in the settings app
Updating branch refs/heads/master to f6a34c5144f05eaf8327eca02da724353c542dff (commit) from ee9c70df22b26648ec734e84181f4bf27a892aec (commit) commit f6a34c5144f05eaf8327eca02da724353c542dff Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 10:59:48 2013 +0300 Fix memory leaks in the settings app settings/main.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/settings/main.c b/settings/main.c index 86d4bbd..f5d59dd 100644 --- a/settings/main.c +++ b/settings/main.c @@ -305,7 +305,7 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model, GtkTreeIter *iter, AppearancePanel *panel) { -gchar *filename; +gchar *filename = NULL; gtk_tree_model_get(model, iter, COL_FILENAME, filename, -1); @@ -319,6 +319,9 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model, xfdesktop_settings_add_file_to_queue(panel, pdata); } + +if(filename) +g_free(filename); } static void @@ -1430,6 +1433,8 @@ cb_update_background_tab(WnckWindow *wnck_window, if(panel-monitor_name != NULL) g_free(panel-monitor_name); +if(monitor_name != NULL) +g_free(monitor_name); panel-workspace = workspace_num; panel-screen = screen_num; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfdesktop:master Add a chronological backdrop cycle option
Updating branch refs/heads/master to d12988225513fff7c219df973dd11e18a4670a27 (commit) from 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30 (commit) commit d12988225513fff7c219df973dd11e18a4670a27 Author: Eric Koegel eric.koe...@gmail.com Date: Mon Oct 21 09:11:46 2013 +0300 Add a chronological backdrop cycle option When cycling backdrops sequentially with a period of hourly, setting this option causes xfdesktop to map files in the selected directory to hours of the day. Fewer images in the directory than hours in the day are handled by repeating images to scale them over the time range. That means there will be at most 24 images displayed showing the first image from midnight to one, the second from one until two o'clock, etc. If there were 6 images in the directory then every image would be displayed for 4 hour time intervals before advancing. If there's more images in the folder than hours then they won't be shown. The entire point is that the user can have darker backdrops shown at night or do other fancy time of day image selections (i.e. one image in the morning, one in the afternoon, one in the evening, etc). common/xfdesktop-common.c | 128 common/xfdesktop-common.h |3 - settings/main.c| 36 +++ .../xfdesktop-settings-appearance-frame-ui.glade | 16 + src/xfce-backdrop.c| 310 +++- src/xfce-backdrop.h|6 + src/xfce-workspace.c | 32 +- 7 files changed, 372 insertions(+), 159 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index bf86ba4..2011e6c 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -53,134 +53,6 @@ #include xfdesktop-common.h #include xfce-backdrop.h /* for XfceBackdropImageStyle */ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -static GList * -list_files_in_dir(const gchar *path) -{ -GDir *dir; -gboolean needs_slash = TRUE; -const gchar *file; -GList *files = NULL; - -dir = g_dir_open(path, 0, 0); -if(!dir) -return NULL; - -if(path[strlen(path)-1] == '/') -needs_slash = FALSE; - -while((file = g_dir_read_name(dir))) { -gchar *current_file = g_strdup_printf(needs_slash ? %s/%s : %s%s, - path, file); - -files = g_list_insert_sorted(files, current_file, (GCompareFunc)g_strcmp0); -} - -g_dir_close(dir); - -return files; -} - -/* Gets the next valid image file in the folder. Free when done using it - * returns NULL on fail. */ -gchar * -xfdesktop_backdrop_choose_next(const gchar *filename) -{ -GList *files, *current_file, *start_file; -gchar *file = NULL; - -g_return_val_if_fail(filename, NULL); - -/* We don't cache the list at all. This way the user can add/remove items - * whenever they like without xfdesktop having to do anything */ -files = list_files_in_dir(g_path_get_dirname(filename)); -if(!files) -return NULL; - -/* Get the our current background in the list */ -current_file = g_list_find_custom(files, filename, (GCompareFunc)g_strcmp0); - -/* if somehow we don't have a valid file, grab the first one available */ -if(current_file == NULL) -current_file = g_list_first(files); - -start_file = current_file; - -/* We want the next valid image file in the dir while making sure - * we don't loop on ourselves */ -do { -current_file = g_list_next(current_file); - -/* we hit the end of the list */ -if(current_file == NULL) -current_file = g_list_first(files); - -/* We went through every item in the list */ -if(g_strcmp0(start_file-data, current_file-data) == 0) -break; - -} while(!xfdesktop_image_file_is_valid(current_file-data)); - -file = g_strdup(current_file-data); -g_list_free_full(files, g_free); - -return file; -} - -/* Gets a random valid image file in the folder. Free when done using it. - * returns NULL on fail. */ -gchar * -xfdesktop_backdrop_choose_random(const gchar *filename) -{ -static gint previndex = -1; -GList *files; -gchar *file = NULL; -gint n_items = 0, cur_file, tries = 0; - -g_return_val_if_fail(filename, NULL); - -/* We don't cache the list at all. This way the user can add/remove items - * whenever they like without xfdesktop having to do anything */ -files = list_files_in_dir(g_path_get_dirname(filename)); -if(!files) -return NULL; - -n_items = g_list_length(files); - -/* If there's only 1 item, just return it, easy */ -if(1 == n_items) { -file = g_strdup(g_list_first(files)-data); -g_list_free_full(files, g_free); -return file; -} - -do
[Xfce4-commits] xfdesktop:master Additonal backdrop cycle options
Updating branch refs/heads/master to 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30 (commit) from c460b0acb86791eb7ee9d954fae505589b88a68a (commit) commit 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30 Author: Eric Koegel eric.koe...@gmail.com Date: Sat Oct 19 21:20:43 2013 +0300 Additonal backdrop cycle options Xfdesktop can now change the backdrop every x seconds, minutes, or hours. It can also change every hour on the hour, or every day, or just during start up. common/xfdesktop-common.c | 31 ++-- settings/main.c| 70 ++- .../xfdesktop-settings-appearance-frame-ui.glade | 31 +++- src/xfce-backdrop.c| 192 ++-- src/xfce-backdrop.h| 16 ++ src/xfce-workspace.c | 46 - 6 files changed, 340 insertions(+), 46 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 6d5546d..bf86ba4 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -84,7 +84,8 @@ list_files_in_dir(const gchar *path) return files; } - +/* Gets the next valid image file in the folder. Free when done using it + * returns NULL on fail. */ gchar * xfdesktop_backdrop_choose_next(const gchar *filename) { @@ -93,6 +94,8 @@ xfdesktop_backdrop_choose_next(const gchar *filename) g_return_val_if_fail(filename, NULL); +/* We don't cache the list at all. This way the user can add/remove items + * whenever they like without xfdesktop having to do anything */ files = list_files_in_dir(g_path_get_dirname(filename)); if(!files) return NULL; @@ -127,10 +130,11 @@ xfdesktop_backdrop_choose_next(const gchar *filename) return file; } +/* Gets a random valid image file in the folder. Free when done using it. + * returns NULL on fail. */ gchar * xfdesktop_backdrop_choose_random(const gchar *filename) { -static gboolean __initialized = FALSE; static gint previndex = -1; GList *files; gchar *file = NULL; @@ -138,30 +142,21 @@ xfdesktop_backdrop_choose_random(const gchar *filename) g_return_val_if_fail(filename, NULL); +/* We don't cache the list at all. This way the user can add/remove items + * whenever they like without xfdesktop having to do anything */ files = list_files_in_dir(g_path_get_dirname(filename)); if(!files) return NULL; n_items = g_list_length(files); +/* If there's only 1 item, just return it, easy */ if(1 == n_items) { file = g_strdup(g_list_first(files)-data); g_list_free_full(files, g_free); return file; } -/* NOTE: 4.3BSD random()/srandom() are a) stronger and b) faster than -* ANSI-C rand()/srand(). So we use random() if available */ -if(G_UNLIKELY(!__initialized)){ -guint seed = time(NULL) ^ (getpid() + (getpid() 15)); -#ifdef HAVE_SRANDOM -srandom(seed); -#else -srand(seed); -#endif -__initialized = TRUE; -} - do { if(tries++ == n_items) { /* this isn't precise, but if we've failed to get a good @@ -172,17 +167,15 @@ xfdesktop_backdrop_choose_random(const gchar *filename) } do { -#ifdef HAVE_SRANDOM -cur_file = random() % n_items; -#else -cur_file = rand() % n_items; -#endif +/* g_random_int_range bounds to n_items-1 */ +cur_file = g_random_int_range(0, n_items); } while(cur_file == previndex G_LIKELY(previndex != -1)); } while(!xfdesktop_image_file_is_valid(g_list_nth(files, cur_file)-data)); previndex = cur_file; +/* Keep a copy of our new random item, free everything else */ file = g_strdup(g_list_nth(files, cur_file)-data); g_list_free_full(files, g_free); diff --git a/settings/main.c b/settings/main.c index 84340f0..cbc7e2d 100644 --- a/settings/main.c +++ b/settings/main.c @@ -109,8 +109,10 @@ typedef struct gulong color1_btn_id; gulong color2_btn_id; -GtkWidget *backdrop_cycle_spinbox; +/* backdrop cycling options */ GtkWidget *backdrop_cycle_chkbox; +GtkWidget *combo_backdrop_cycle_period; +GtkWidget *backdrop_cycle_spinbox; GtkWidget *random_backdrop_order_chkbox; GThread *preview_thread; @@ -877,11 +879,42 @@ cb_xfdesktop_chk_custom_font_size_toggled(GtkCheckButton *button, } static void +update_backdrop_cycle_spinbox(AppearancePanel *panel) +{ +gboolean sensitive = FALSE; +gint period; + +/* For the spinbox to be active the combo_backdrop_cycle_period needs to be + * active and needs to be set to something where the spinbox would apply */ +if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) { +period = gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period)); +if(period
[Xfce4-commits] xfdesktop:master Include the chronological option in the combobox
Updating branch refs/heads/master to 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit) from 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a (commit) commit 715985a0cfdcabe4eacc391c8f37690d343351e7 Author: Eric Koegel eric.koe...@gmail.com Date: Tue Oct 22 21:08:23 2013 +0300 Include the chronological option in the combobox settings/main.c| 49 .../xfdesktop-settings-appearance-frame-ui.glade | 18 + src/xfce-backdrop.c| 79 +++- src/xfce-backdrop.h|7 +- src/xfce-workspace.c |5 -- 5 files changed, 28 insertions(+), 130 deletions(-) diff --git a/settings/main.c b/settings/main.c index 3e92b16..b63ee3c 100644 --- a/settings/main.c +++ b/settings/main.c @@ -116,7 +116,6 @@ typedef struct GtkWidget *combo_backdrop_cycle_period; GtkWidget *backdrop_cycle_spinbox; GtkWidget *random_backdrop_order_chkbox; -GtkWidget *chrono_backdrop_order_chkbox; GThread *preview_thread; GAsyncQueue *preview_queue; @@ -884,43 +883,41 @@ cb_xfdesktop_chk_button_toggled(GtkCheckButton *button, } static void -update_backdrop_cycle_spinbox(AppearancePanel *panel) +update_backdrop_random_order_chkbox(AppearancePanel *panel) { gboolean sensitive = FALSE; gint period; -/* For the spinbox to be active the combo_backdrop_cycle_period needs to be - * active and needs to be set to something where the spinbox would apply */ +/* For the random check box to be active the combo_backdrop_cycle_period + * needs to be active and needs to not be set to chronological */ if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) { period = gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period)); -if(period == XFCE_BACKDROP_PERIOD_SECONDS || - period == XFCE_BACKDROP_PERIOD_MINUES || - period == XFCE_BACKDROP_PERIOD_HOURS) -{ +if(period != XFCE_BACKDROP_PERIOD_CHRONOLOGICAL) sensitive = TRUE; -} } -gtk_widget_set_sensitive(panel-backdrop_cycle_spinbox, sensitive); +gtk_widget_set_sensitive(panel-random_backdrop_order_chkbox, sensitive); } static void -update_backdrop_chrono_order_chkbox(AppearancePanel *panel) +update_backdrop_cycle_spinbox(AppearancePanel *panel) { gboolean sensitive = FALSE; gint period; -/* For this check box to be active the combo_backdrop_cycle_period needs - * to be active and needs to be set to hourly so it would apply */ +/* For the spinbox to be active the combo_backdrop_cycle_period needs to be + * active and needs to be set to something where the spinbox would apply */ if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) { period = gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period)); -if(period == XFCE_BACKDROP_PERIOD_HOURLY) +if(period == XFCE_BACKDROP_PERIOD_SECONDS || + period == XFCE_BACKDROP_PERIOD_MINUES || + period == XFCE_BACKDROP_PERIOD_HOURS) { sensitive = TRUE; } } -gtk_widget_set_sensitive(panel-chrono_backdrop_order_chkbox, sensitive); +gtk_widget_set_sensitive(panel-backdrop_cycle_spinbox, sensitive); } static void @@ -931,8 +928,8 @@ cb_combo_backdrop_cycle_period_change(GtkComboBox *combo, /* determine if the spin box should be sensitive */ update_backdrop_cycle_spinbox(panel); -/* same with the chronological backdrop order */ -update_backdrop_chrono_order_chkbox(panel); +/* determine if the random check box should be sensitive */ +update_backdrop_random_order_chkbox(panel); } static void @@ -950,11 +947,10 @@ cb_xfdesktop_chk_cycle_backdrop_toggled(GtkCheckButton *button, /* The cycle backdrop toggles the period and random widgets */ gtk_widget_set_sensitive(panel-combo_backdrop_cycle_period, sensitive); -gtk_widget_set_sensitive(panel-random_backdrop_order_chkbox, sensitive); /* determine if the spin box should be sensitive */ update_backdrop_cycle_spinbox(panel); -/* same with the chronological backdrop order */ -update_backdrop_chrono_order_chkbox(panel); +/* determine if the random check box should be sensitive */ +update_backdrop_random_order_chkbox(panel); } static gboolean @@ -1343,17 +1339,6 @@ xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel, G_OBJECT(panel-random_backdrop_order_chkbox), active); } g_free(buf); - -/* chronological order check box */ -buf = xfdesktop_settings_generate_per_workspace_binding_string(panel, backdrop-cycle-chronological-order); -if(remove_binding) { -xfconf_g_property_unbind_by_property(channel, buf, - G_OBJECT(panel
[Xfce4-commits] xfdesktop:master Fix some memory leaks
Updating branch refs/heads/master to 2f9278f47973b337f52619afece20cf498664fd6 (commit) from 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit) commit 2f9278f47973b337f52619afece20cf498664fd6 Author: Eric Koegel eric.koe...@gmail.com Date: Sun Oct 27 09:29:43 2013 +0300 Fix some memory leaks common/xfdesktop-thumbnailer.c| 38 +++- src/xfce-backdrop.c | 39 ++--- src/xfce-desktop.c| 30 src/xfce-workspace.c |2 ++ src/xfdesktop-file-icon-manager.c | 17 +--- 5 files changed, 91 insertions(+), 35 deletions(-) diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c index 2416d8b..248a3c5 100644 --- a/common/xfdesktop-thumbnailer.c +++ b/common/xfdesktop-thumbnailer.c @@ -340,7 +340,7 @@ xfdesktop_thumbnailer_queue_thumbnail(XfdesktopThumbnailer *thumbnailer, if(g_slist_find(thumbnailer-priv-queue, file) == NULL) { thumbnailer-priv-queue = g_slist_prepend(thumbnailer-priv-queue, - file); + g_strdup(file)); } thumbnailer-priv-request_timer_id = g_timeout_add_full( @@ -370,6 +370,8 @@ void xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer, gchar *file) { +GSList *item; + g_return_if_fail(XFDESKTOP_IS_THUMBNAILER(thumbnailer)); g_return_if_fail(file != NULL); @@ -392,9 +394,11 @@ xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer, thumbnailer-priv-handle = 0; } -if(g_slist_find(thumbnailer-priv-queue, file) != NULL) { -thumbnailer-priv-queue = g_slist_remove_all(thumbnailer-priv-queue, - file); +item = g_slist_find(thumbnailer-priv-queue, file); +if(item != NULL) { +g_free(item-data); +thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue, + file); } thumbnailer-priv-request_timer_id = g_timeout_add_full( @@ -436,6 +440,7 @@ xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer) file = g_file_new_for_path(iter-data); uris[i] = g_file_get_uri(file); mimetypes[i] = xfdesktop_get_file_mimetype(iter-data); + g_object_unref(file); } iter = g_slist_next(iter); @@ -465,6 +470,18 @@ xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer) } } +/* Free the memory */ +i = 0; +iter = thumbnailer-priv-queue; +while(iter) { +if(iter-data) { +g_free(uris[i]); +g_free(mimetypes[i]); +} +iter = g_slist_next(iter); +i++; +} + g_free(uris); g_free(mimetypes); @@ -498,7 +515,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, gchar *thumbnail_location; GFile *file; GSList *iter = thumbnailer-priv-queue; -gchar *f_uri, *f_uri_checksum, *filename; +gchar *f_uri, *f_uri_checksum, *filename, *temp; gchar *thumbnail_flavor; gint x = 0; @@ -531,8 +548,8 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, filename, NULL); DBG(thumbnail-ready src: %s thumbnail: %s, -(char*)iter-data, -thumbnail_location); +(char*)iter-data, +thumbnail_location); g_signal_emit(G_OBJECT(thumbnailer), thumbnailer_signals[THUMBNAIL_READY], @@ -540,14 +557,17 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy, iter-data, thumbnail_location); +temp = iter-data; thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue, - iter-data); + temp); iter = thumbnailer-priv-queue; x++; - + g_free(filename); g_free(f_uri_checksum); +g_free(thumbnail_location); +g_free(temp); } else { iter = g_slist_next(iter); } diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c index 14ce700..929c6ee 100644 --- a/src/xfce-backdrop.c +++ b/src/xfce-backdrop.c @@ -240,29 +240,36 @@ xfce_backdrop_clear_cached_image(XfceBackdrop *backdrop) backdrop-priv-pix = NULL; } +/* Returns a GList of all the files in the parent directory of filename */ static GList * -list_files_in_dir(const gchar *path) +list_files_in_dir(const gchar *filename) { GDir *dir; gboolean needs_slash = TRUE; const
[Xfce4-commits] xfdesktop:master More removable device icon types (Bug 4056)
Updating branch refs/heads/master to c460b0acb86791eb7ee9d954fae505589b88a68a (commit) from 7fd36c23d7e72cec2721c5324b63ca1e57dd2fef (commit) commit c460b0acb86791eb7ee9d954fae505589b88a68a Author: Eric Koegel eric.koe...@gmail.com Date: Tue Oct 15 19:25:30 2013 +0300 More removable device icon types (Bug 4056) In xfdesktop-settings the removable devices option now has an expander allowing the user to show network shares, devices, or unknown/other volumes (such as mtp devices). common/xfdesktop-common.h |9 ++ settings/main.c | 38 --- src/xfdesktop-file-icon-manager.c | 218 ++--- src/xfdesktop-file-icon-manager.h | 13 --- src/xfdesktop-file-utils.c| 131 -- src/xfdesktop-file-utils.h|3 - src/xfdesktop-volume-icon.c | 11 -- 7 files changed, 162 insertions(+), 261 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 4dcec73..88e86c5 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -53,6 +53,15 @@ #define SINGLE_WORKSPACE_MODE /backdrop/single-workspace-mode #define SINGLE_WORKSPACE_NUMBER /backdrop/single-workspace-number +#define DESKTOP_ICONS_SHOW_THUMBNAILS/desktop-icons/show-thumbnails +#define DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE /desktop-icons/file-icons/show-network-removable +#define DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE /desktop-icons/file-icons/show-device-removable +#define DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE /desktop-icons/file-icons/show-unknown-removable +#define DESKTOP_ICONS_SHOW_HOME /desktop-icons/file-icons/show-home +#define DESKTOP_ICONS_SHOW_TRASH /desktop-icons/file-icons/show-trash +#define DESKTOP_ICONS_SHOW_FILESYSTEM /desktop-icons/file-icons/show-filesystem +#define DESKTOP_ICONS_SHOW_REMOVABLE /desktop-icons/file-icons/show-removable + /** * File information namespaces queried for #GFileInfo objects. */ diff --git a/settings/main.c b/settings/main.c index 74da46e..84340f0 100644 --- a/settings/main.c +++ b/settings/main.c @@ -76,12 +76,6 @@ #define DESKTOP_ICONS_FONT_SIZE_PROP /desktop-icons/font-size #define DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP /desktop-icons/use-custom-font-size #define DESKTOP_ICONS_SINGLE_CLICK_PROP /desktop-icons/single-click -#define DESKTOP_ICONS_SHOW_THUMBNAILS_PROP /desktop-icons/show-thumbnails -#define DESKTOP_ICONS_SHOW_HOME /desktop-icons/file-icons/show-home -#define DESKTOP_ICONS_SHOW_TRASH /desktop-icons/file-icons/show-trash -#define DESKTOP_ICONS_SHOW_FILESYSTEM /desktop-icons/file-icons/show-filesystem -#define DESKTOP_ICONS_SHOW_REMOVABLE /desktop-icons/file-icons/show-removable - typedef struct { @@ -342,7 +336,7 @@ cb_special_icon_toggled(GtkCellRendererToggle *render, gchar *path, gpointer use xfconf_channel_set_bool(channel, icon_property, show_icon); -gtk_list_store_set(GTK_LIST_STORE(model), iter, +gtk_tree_store_set(GTK_TREE_STORE(model), iter, COL_ICON_ENABLED, show_icon, -1); gtk_tree_path_free(tree_path); @@ -354,10 +348,10 @@ setup_special_icon_list(GtkBuilder *gxml, XfconfChannel *channel) { GtkWidget *treeview; -GtkListStore *ls; +GtkTreeStore *ts; GtkTreeViewColumn *col; GtkCellRenderer *render; -GtkTreeIter iter; +GtkTreeIter iter, parent_iter, child_iter; const struct { const gchar *name; const gchar *icon; @@ -373,14 +367,21 @@ setup_special_icon_list(GtkBuilder *gxml, DESKTOP_ICONS_SHOW_TRASH, TRUE }, { N_(Removable Devices), drive-removable-media, gnome-dev-removable, DESKTOP_ICONS_SHOW_REMOVABLE, TRUE }, +{ N_(Network Shares), network_fs, gnome-dev-network, + DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, TRUE }, +{ N_(Disks and Drives), drive-harddisk-usb, gnome-dev-removable-usb, + DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, TRUE }, +{ N_(Other Items), phone-symbolic, phone, + DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, TRUE }, { NULL, NULL, NULL, NULL, FALSE }, }; +const int REMOVABLE_DEVICES = 4; int i, w; GtkIconTheme *itheme = gtk_icon_theme_get_default(); gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, w, NULL); -ls = gtk_list_store_new(N_ICON_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, +ts = gtk_tree_store_new(N_ICON_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING); for(i = 0; icons[i].name; ++i) { GdkPixbuf *pix = NULL; @@ -390,8 +391,15 @@ setup_special_icon_list(GtkBuilder *gxml, else pix = gtk_icon_theme_load_icon(itheme, icons[i].icon_fallback, w, 0, NULL); -gtk_list_store_append(ls, iter); -gtk_list_store_set(ls, iter