~noskcaj/ubuntu/trusty/xfdesktop4/merge

« back to all changes in this revision

Viewing changes to debian/patches/xubuntu_avoid-multiple-instances.patch

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-01-09 19:22:54 UTC
  • Revision ID: package-import@ubuntu.com-20120109192254-6m84ewh01sb82gdc
Tags: 4.8.3-1ubuntu4
* debian/patches:
  - xubuntu_avoid-multiple-instances.patch: updated, and simplified.
  - xubuntu_improve-nautilus-interactions.patch: added, should prevent
    nautilus from taking over the desktop if xfdesktop is running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 Not forwardable, because it's a hack.
13
13
Author: Lionel Le Folgoc <mrpouit@ubuntu.com>
14
14
Forwarded: not-needed
15
 
Last-Update: 2012-01-04
 
15
Last-Update: 2012-01-09
16
16
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xfdesktop4/+bug/329616
 
17
 
17
18
--- xfdesktop4-4.8.3.orig/src/xfce-desktop.c
18
19
+++ xfdesktop4-4.8.3/src/xfce-desktop.c
19
 
@@ -472,7 +472,7 @@ xfce_desktop_monitors_changed(GdkScreen
20
 
 static void
21
 
 screen_set_selection(XfceDesktop *desktop)
22
 
 {
23
 
-    Window xwin;
24
 
+    Window xwin, xid;
25
 
     gint xscreen;
26
 
     gchar selection_name[100];
27
 
     Atom selection_atom, manager_atom;
28
20
@@ -484,6 +484,13 @@ screen_set_selection(XfceDesktop *deskto
29
21
     selection_atom = XInternAtom(GDK_DISPLAY(), selection_name, False);
30
22
     manager_atom = XInternAtom(GDK_DISPLAY(), "MANAGER", False);
31
23
 
32
 
+    if(xfdesktop_check_is_running(&xid)) {
33
 
+        /* the previous check in src/main.c occurs too early, so workaround by
34
 
+         * adding this one. Hopefully it should help for lp #329616 */
 
24
+    /* the previous check in src/main.c occurs too early, so workaround by
 
25
+     * adding this one. Hopefully it should help for lp #329616 */
 
26
+    if(XGetSelectionOwner(GDK_DISPLAY(), selection_atom) != None) {
35
27
+        g_warning("%s: already running, quitting.", PACKAGE);
36
28
+        exit(0);
37
29
+    }