Merge lp:~robert-ancell/unity-settings-daemon/xdg-current-desktop into lp:unity-settings-daemon

Proposed by Robert Ancell
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 4133
Merged at revision: 4133
Proposed branch: lp:~robert-ancell/unity-settings-daemon/xdg-current-desktop
Merge into: lp:unity-settings-daemon
Diff against target: 42 lines (+24/-1)
1 file modified
plugins/xsettings/gsd-xsettings-manager.c (+24/-1)
To merge this branch: bzr merge lp:~robert-ancell/unity-settings-daemon/xdg-current-desktop
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+289105@code.launchpad.net

Commit message

Correctly check value of XDG_CURRENT_DESKTOP.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

great

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/xsettings/gsd-xsettings-manager.c'
--- plugins/xsettings/gsd-xsettings-manager.c 2016-02-09 09:56:17 +0000
+++ plugins/xsettings/gsd-xsettings-manager.c 2016-03-15 20:36:25 +0000
@@ -434,6 +434,29 @@
434 return dpi * factor;434 return dpi * factor;
435}435}
436436
437static gboolean
438in_desktop (const gchar *name)
439{
440 const gchar *desktop_name_list;
441 gchar **names;
442 gboolean in_list = FALSE;
443 gint i;
444
445 desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
446 if (!desktop_name_list)
447 return FALSE;
448
449 names = g_strsplit (desktop_name_list, ":", -1);
450 for (i = 0; names[i] && !in_list; i++)
451 if (strcmp (names[i], name) == 0) {
452 in_list = TRUE;
453 break;
454 }
455 g_strfreev (names);
456
457 return in_list;
458}
459
437static int460static int
438get_window_scale (GnomeXSettingsManager *manager)461get_window_scale (GnomeXSettingsManager *manager)
439{462{
@@ -453,7 +476,7 @@
453 window_scale = 1;476 window_scale = 1;
454477
455 /* Under Unity let the shell handle the scaling */478 /* Under Unity let the shell handle the scaling */
456 if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)479 if (in_desktop ("Unity"))
457 goto out;480 goto out;
458481
459 display = gdk_display_get_default ();482 display = gdk_display_get_default ();

Subscribers

People subscribed via source and target branches