! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Workspace switcher starting up with wrong number of rows
Status:
RESOLVED: DUPLICATE
Product:
Xfce4-panel
Component:
Workspace Switcher

Comments

Description Dr. David Alan Gilbert 2015-04-19 14:27:12 CEST
(Fedora 22 packaged xfce4-panel-4.12.0-3.fc22.x86_64)
I have two monitors, each has it's own panel, and each panel has it's own identically configured workspace switcher widget.
I have 9 workspaces, and the switcher widgets are configured to show them as 3 rows (so I have a 3x3 grid).

On one of my monitors, the workspace switcher always starts up correctly, on the other it always starts up showing a row of 9 workspaces.  If I right click and bring up the properties dialog it immediately springs into the right 3x3 shape before I've done anything with the dialog.

Looking at .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml I see two
sections for pager data:

    <property name="plugin-4" type="string" value="pager">
      <property name="rows" type="uint" value="3"/>
    </property>

and

    <property name="plugin-7" type="string" value="pager">
      <property name="rows" type="uint" value="3"/>
    </property>

so they do agree.
Comment 1 Dr. David Alan Gilbert 2015-04-19 16:02:35 CEST
(Actually; kind of side comment - why is the rows value associated with the panel widget?   Given that there are shortcut binds for the window manager for up/down/right/left in workspaces it seems odd to have this setting on the panel widget).
Comment 2 Dr. David Alan Gilbert 2015-04-27 19:43:52 CEST
Noticed in .xsession-errors:

libpager-Message: Setting the pager rows returned false. Maybe the setting is not applied.

I'm not sure when that was logged though.
Comment 3 Dr. David Alan Gilbert 2015-05-25 01:17:26 CEST
that libpager message error seems to come from the call to 

  wnck_pager_set_n_rows

and it can only return the error case if the wnck_pager_set_layout_hint fails.
Comment 4 Dr. David Alan Gilbert 2015-05-31 17:48:14 CEST
I think I understand-ish why this is happening, and have a fix that makes it work, but I'm not sure if there are any side effects.
First the fix:

--- plugins/pager/pager.c	2015-02-26 20:32:17.000000000 +0000
+++ fixed/plugins/pager/pager.c	2015-05-31 16:23:35.682554450 +0100
@@ -320,8 +320,8 @@
   if (G_UNLIKELY (plugin->pager != NULL))
     {
       gtk_widget_destroy (GTK_WIDGET (plugin->pager));
-      wnck_screen_force_update (plugin->wnck_screen);
     }
+  wnck_screen_force_update (plugin->wnck_screen);
 
   mode = xfce_panel_plugin_get_mode (XFCE_PANEL_PLUGIN (plugin));
   orientation =

---------------------

Now some explanation; I added a lot of debug in libwnck

wnck_pager_set_layout_hint: Entry for 0x26bb1e0
_wnck_pager_set_screen: entry for 0x26bb1e0
_wnck_pager_set_screen: Exit for !gtk_widget_has_screen
wnck_pager_set_layout_hint: pager->priv->screen==NULL
libpager-Message: Setting the pager rows returned false. Maybe the setting is not applied.
_wnck_pager_set_screen: entry for 0x26bb1e0
wnck_pager_set_layout_hint: Entry for 0x26bb1e0
wnck_screen_try_set_workspace_layout entry: screen=0x26938b0 current_token=0 rows=3 columns=0
wnck_pager_set_layout_hint: bottom 1
_wnck_pager_set_screen: Exit bottom
wnck_pager_set_layout_hint: Entry for 0x26bb620
_wnck_pager_set_screen: entry for 0x26bb620
_wnck_pager_set_screen: Exit for !gtk_widget_has_screen
wnck_pager_set_layout_hint: pager->priv->screen==NULL
libpager-Message: Setting the pager rows returned false. Maybe the setting is not applied.
_wnck_pager_set_screen: entry for 0x26bb620
wnck_pager_set_layout_hint: Entry for 0x26bb620
wnck_screen_try_set_workspace_layout entry: screen=0x26938b0 current_token=0 rows=3 columns=0
wnck_pager_set_layout_hint: bottom 0
_wnck_pager_set_screen: in !set_layout_hint branch, before get_workspace_layout n_rows=3
!!! _wnck_pager_set_screen: in !set_layout_hint branch, after get_workspace_layout n_rows=1
_wnck_pager_set_screen: Exit bottom
update_workspace_layout on 0x26938b0
!!! update_workspace_layout on 0x26938b0: num_workspaces=9 rows=3 cols=0
update_workspace_layout on 0x26938b0

Note the two lines with !!!
What I think happens is that the 1st pager instance works OK, but for the 2nd pager we end up in _wnck_pager_set_screen   and it has:
  if (!wnck_pager_set_layout_hint (pager))
    {
      _WnckLayoutOrientation orientation;

      /* we couldn't set the layout on the screen. This means someone else owns
       * it. Let's at least show the correct layout. */
      _wnck_screen_get_workspace_layout (pager->priv->screen,
                                         &orientation,
                                         &pager->priv->n_rows,
                                         NULL, NULL);


that should ensure that the 2nd pager has the same layout, but it doesn't work because as from that debug we see:

_wnck_pager_set_screen: in !set_layout_hint branch, after get_workspace_layout n_rows=1

so _wnck_screen_get_workspace_layout is getting the wrong answer - why?
Well I think it's set by update_workspace_layout, and we only see that called
later in the debug; it's normally called on idle - see update_idle.
But I guess there's no idle between the two pagers, so we get to the second pager and haven't setup it's screen's row data yet.
I'm not sure if wnck3 is any better at this; but is there any downside to just doing that force_update ?

Dave
Comment 5 Dr. David Alan Gilbert 2015-06-02 20:56:49 CEST
hmm; hang off on that fix - it works if I kill the panel and restart it; however it still failed at start of session.
Comment 6 Andre Miranda editbugs 2018-09-15 18:28:23 CEST
*** Bug 14643 has been marked as a duplicate of this bug. ***
Comment 7 Simon Steinbeiss editbugs 2019-08-19 01:22:38 CEST
*** Bug 15834 has been marked as a duplicate of this bug. ***
Comment 8 Simon Steinbeiss editbugs 2019-08-19 02:03:11 CEST
Indeed, I can confirm the bug. I'm not sure it's in the panel though, I think it's a limitation of libwnck.

From reading the code (and documentation) about that call only one pager widget should try to set the rows (i.e. you shouldn't really be able to configure two pager widgets differently consistently).
https://gitlab.gnome.org/GNOME/libwnck/blob/master/libwnck/pager.c#L2330


Also, I just noticed that Nick already understood this a looooong time ago. So marking this bug as a duplicate too...
Comment 9 Simon Steinbeiss editbugs 2019-08-19 02:03:19 CEST

*** This bug has been marked as a duplicate of bug 6555 ***

Bug #11831

Reported by:
Dr. David Alan Gilbert
Reported on: 2015-04-19
Last modified on: 2019-08-19
Duplicates (2):
  • 14643 Display of 2nd panel workspace switcher shows only one row at boot until its properties opened 1x8 vice 2x4
  • 15834 Number of rows not shown in 2nd switcher when starting xfce desktop

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Version:
4.12.0

Attachments

Additional information