[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#933959: xfce4-panel: Option to configure panel placement on external monitor only



Package: xfce4-panel
Version: 4.12.2-1
Severity: wishlist
Tags: patch upstream

Dear Maintainer,

The panel "Output" settings does not allow easily to configure option where it would be placed on any connected external monitor (regardless of name of the monitor), while not shown on the primary laptop monitor when there is no external monitor attached. The patch adds and "Non-primary" option to the panel preferences "Output" list allowing that behaviour.

Similar wish has been described e.g. here:

http://colinrrobinson.com/technology/linux/xfce/automatically-switch-xfce-panel-layout-plugging-monitor/

(there the solution is quite heavy, using Xubuntu tool xfpanel-switch).

Feel free to forward the bug upstream if you would find it useful.

Best regards,
Pavel




-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (840, 'testing'), (740, 'unstable'), (738, 'experimental'), (540, 'proposed-updates'), (540, 'stable'), (500, 'oldstable-proposed-updates'), (500, 'oldoldstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-5-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xfce4-panel depends on:
ii  exo-utils            0.12.6-1
ii  libatk1.0-0          2.32.0-2
ii  libc6                2.28-10
ii  libcairo2            1.16.0-4
ii  libdbus-1-3          1.12.16-1
ii  libdbus-glib-1-2     0.110-4
ii  libexo-1-0           0.12.6-1
ii  libfontconfig1       2.13.1-2
ii  libfreetype6         2.9.1-4
ii  libgarcon-1-0        0.6.3-1
ii  libgdk-pixbuf2.0-0   2.38.1+dfsg-1
ii  libglib2.0-0         2.60.6-1
ii  libgtk2.0-0          2.24.32-3
ii  libice6              2:1.0.9-2
ii  libpango-1.0-0       1.42.4-6
ii  libpangocairo-1.0-0  1.42.4-6
ii  libpangoft2-1.0-0    1.42.4-6
ii  libsm6               2:1.2.3-1
ii  libwnck22            2.30.7-6
ii  libx11-6             2:1.6.7-1
ii  libxext6             2:1.3.3-1+b2
ii  libxfce4ui-1-0       4.12.1-3
ii  libxfce4util7        4.12.1-3
ii  libxfconf-0-2        4.12.1-1+b1

xfce4-panel recommends no packages.

xfce4-panel suggests no packages.

-- no debconf information
--- old/panel/panel-preferences-dialog.c
+++ new/panel/panel-preferences-dialog.c
@@ -506,6 +506,15 @@
           output_selected = TRUE;
           span_monitors_sensitive = TRUE;
         }
+      gtk_list_store_insert_with_values (GTK_LIST_STORE (store), &iter, n++,
+                                         OUTPUT_NAME, "Non-primary",
+                                         OUTPUT_TITLE, _("Non-primary"), -1);
+      if (g_strcmp0 (output_name, "Non-primary") == 0)
+        {
+          gtk_combo_box_set_active_iter (GTK_COMBO_BOX (object), &iter);
+          output_selected = TRUE;
+          span_monitors_sensitive = TRUE;
+        }
 
       if (n_screens > 1)
         {
--- old/panel/panel-window.c
+++ new/panel/panel-window.c
@@ -2040,6 +2040,8 @@
             }
           else
             {
+              gint monitor_num_primary = gdk_screen_get_primary_monitor (screen);
+              gboolean is_non_primary = g_strcmp0 (window->output_name, "Non-primary") == 0;
               /* detect the monitor number by output name */
               for (n = 0, monitor_num = -1; n < n_monitors && monitor_num == -1; n++)
                 {
@@ -2065,7 +2067,9 @@
                     }
 
                   /* check if this is the monitor we're looking for */
-                  if (strcmp (window->output_name, name) == 0)
+                  if ( is_non_primary && n != monitor_num_primary)
+                    monitor_num = n;
+                  else if (strcmp (window->output_name, name) == 0)
                     monitor_num = n;
 
                   g_free (name);

Reply to: