Dock Positioning Issue

Bug #2031981 reported by mario spano
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Plank
New
Undecided
Unassigned

Bug Description

I'm facing an issue with the dock's position on my system. The dock icons appear too high compared to other elements on the screen.

version: 0.11.89
Linux Mint 21.2 Victoria
Xfwm4
xfce4-panel 4.18.2 (Xfce 4.18)

Revision history for this message
mario spano (marspan78) wrote :
Revision history for this message
James Sinton (jksinton) wrote :

Hi, I'm experiencing the same issue with a similar installation (Plank v 0.11.89, and Xfce v 4.16) on Xubuntu 22.04.3.

When an Xfce panel is set in horizontal mode on the bottom of the screen, plank arranges itself to be above the panel even if the length of the Xfce panel does not span the whole length of the screen. Therefore, Plank is effectively arranged with a gap between itself and the bottom of the screen. I did not encounter this issue when on 20.04.

A workaround is to quit Plank. Change the mode of the Xfce panel to vertical or deskbar. Launch Plank, and switch back to horizontal mode for the Xfce panel. Plank will remain at the bottom of the screen without the offset due to the horizontal mode panel.

Thanks,
James

Revision history for this message
mario spano (marspan78) wrote :

I tried it, and it works, but how can I make it permanent?

Revision history for this message
Paul Portocarrero (paul-portocarrero) wrote :

i have a similar issue. i have it on the left side and when the pc goes to sleep and wake up the dock jumps and stays ever closer to the center of the screen.

if i start plank from terminal i got to catch the following error message:

[CRITICAL 19:26:54.387426] [DockWindow:298] Retry #1 update_size_and_position()

plank --version
  0.11.89
system:
  Host: panda-Asus-Rog Kernel: 5.15.0-82-generic x86_64 bits: 64
    Desktop: MATE 1.26.0 Distro: Linux Mint 21 Vanessa
Graphics:
  Device-1: NVIDIA GA106 [GeForce RTX 3060 Lite Hash Rate] driver: nvidia
    v: 525.125.06
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia resolution:
    1: 1920x1080~60Hz 2: 1920x1080~60Hz
  OpenGL: renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
    v: 4.6.0 NVIDIA 525.125.06

Revision history for this message
James Sinton (jksinton) wrote :

Hi Rico, et al.,

I did some hacking in the source code. The issue seems to be related to how PositionManager (in lib/PositionManager.vala) sets the monitor_geo object for Xfce in the initialize function reproduced below:

  public void initialize ()
   requires (controller.window != null)
  {
   unowned Gdk.Screen screen = controller.window.get_screen ();

   controller.prefs.notify.connect (prefs_changed);
   screen.monitors_changed.connect (screen_changed);
   screen.size_changed.connect (screen_changed);
   screen.composited_changed.connect (screen_composited_changed);

   // NOTE don't call update_monitor_geo to avoid a double-call of dockwindow.set_size on startup
   if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU)) {
    screen.get_monitor_geometry (find_monitor_number (screen, controller.prefs.Monitor), out monitor_geo);
   } else {
    monitor_geo = screen.get_monitor_workarea (find_monitor_number (screen, controller.prefs.Monitor));
   }

   screen_is_composited = screen.is_composited ();
  }

Under my Xfce config, monitor_geo is getting set via get_monitor_workarea in the else block. I hacked the else block to set monitor_geo using get_monitor_geometry instead of get_monitor_workarea, and plank was positioned at the bottom of the screen as expected.

I've tried adding XdgSessionDesktop.XFCE as an option in the if statement, but it's not getting triggered for some reason. I'll play around with it some more.

Best,
James

Here's my build information:

[INFO 22:19:36.376682] [AbstractMain:229] Plank version: 0.11.89.20-396b8-dirty
[INFO 22:19:36.376696] [AbstractMain:230] Kernel version: 6.2.0-39-generic
[INFO 22:19:36.376708] [AbstractMain:231] GLib version: 2.72.4 (2.72.4)
[INFO 22:19:36.376723] [AbstractMain:234] GTK+ version: 3.24.33 (3.24.33)
[INFO 22:19:36.376735] [AbstractMain:237] Wnck version: 40.1.0
[INFO 22:19:36.376759] [AbstractMain:238] Cairo version: 1.16.0
[INFO 22:19:36.376781] [AbstractMain:239] Pango version: 1.50.6

Revision history for this message
James Sinton (jksinton) wrote :

After a little more debugging on my setup, I figured out that my Xubuntu install has these environment variables set:
XDG_SESSION_DESKTOP = xubuntu;
XDG_CURRENT_DESKTOP = XFCE;
DESKTOP_SESSION = xubuntu;

session_desktop is set via get_xdg_session_desktop() in lib/Services/Environment.vala with the relevant part reproduced below:

result = Environment.get_variable ("XDG_SESSION_DESKTOP");
if (result == null)
 result = Environment.get_variable ("XDG_CURRENT_DESKTOP");
if (result == null)
 result = Environment.get_variable ("DESKTOP_SESSION");

Because result get sets to xubuntu via the Environment.get_variable for XDG_SESSION_DESKTOP, the if block for XDG_CURRENT_DESKTOP gets skipped. Thus, session_desktop is set to the default UKNOWN type as xubuntu is not in the enumeration for XdgSessionDesktop regardless of XDG_CURRENT_DESKTOP being set to XFCE.

I might try adding a new XdgSessionDesktop type for xubuntu in Environment.vala as that might be an easier solution that can allow me to update the initialize if block in PositionManager.

Best,
James

Revision history for this message
James Sinton (jksinton) wrote :

Hi All,

Here is an initial proposal for a fix to this issue for an Xubuntu environment (where XDG_SESSION_DESKTOP = xubuntu; XDG_CURRENT_DESKTOP = XFCE; and DESKTOP_SESSION = xubuntu).

First, in lib/Services/Environment.vala, add support for XDG_SESSION_DESKTOP being set to 'xubuntu' with a new case for 'xubuntu' that maps it to XFCE:

  static XdgSessionDesktop from_single_string (string s)
  {
   XdgSessionDesktop result;

   switch (s.down ()) {
   . . .
   case "xubuntu": result = XdgSessionDesktop.XFCE; break;
                        . . .

Next, in lib/PositionManager.vala, allow XFCE to set monitor_geo via screen.get_monitor_geometry():
  public void initialize ()
   requires (controller.window != null)
  {
                        . . .
   bool session_desktop_is_XFCE = environment_is_session_desktop ( XdgSessionDesktop.XFCE );
   bool session_desktop_is_UBUNTU_GNOME = environment_is_session_desktop ( XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU );
   // NOTE don't call update_monitor_geo to avoid a double-call of dockwindow.set_size on startup
   if ( session_desktop_is_XFCE || session_desktop_is_UBUNTU_GNOME ) {
    screen.get_monitor_geometry (find_monitor_number (screen, controller.prefs.Monitor), out monitor_geo);
   } else {
    monitor_geo = screen.get_monitor_workarea (find_monitor_number (screen, controller.prefs.Monitor));
   }

The same update can be made in the function screen_changed() in lib/PositionManager.vala. I'll see if I can prepare a patch based on the above.

As an observation from testing the interaction with the Xfce panel, using the above with screen.get_monitor_geometry() will force Plank to be positioned at the edge of the screen regardless of the arrangement of the Xfce panel. I don't mind this behavior, but it may cause Plank to be positioned on top of the Xfce panel in some situations.

I also found another work around: When the Xfce panel is configured to hide (intelligently or always as set via Panel Preferences), Plank will be positioned at the edge without the offset. Hide intelligently can probably suffice for most users until a suitable fix for Plank is developed.

Mario,

Could you please let me know what your environment variables are set to on your system?

echo $XDG_SESSION_DESKTOP
echo $XDG_CURRENT_DESKTOP
echo $DESKTOP_SESSION

Perhaps, we can find a fix for your Mint install too.

Best,
James

Revision history for this message
Bruno Czekay (truebrunorc) wrote :

Hi,

I just wanted to add that I experience the same behaviour under Ubuntu 22.04 with Mate desktop, with plank set to the left side. After bringing the machine back from screensaver or sleep I can see the following output from plank:

[CRITICAL 16:55:55.971750] [DockWindow:298] Retry #1 update_size_and_position() to force requested values!

My solution is to execute `killall plank && plank &`.

~$ echo $XDG_SESSION_DESKTOP
mate
~$ echo $XDG_CURRENT_DESKTOP
MATE
~$ echo $DESKTOP_SESSION
mate

Best regards,

Bruno

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.