! 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 !
Wrong initial position centered panels
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description Nick Schermer editbugs 2006-02-19 17:15:24 CET
When the panel starts up and you have a fixed centered panel (top, bottom, left,
right) the first empty panel is moved to the wrong position. A moment later the
panel_resize_function aligns everything in the right place.

The problem is caused by the gtk_window_move (panel-properties.c line 439). With
centered windows there is an offset and not a place (x or y). So the current
function only works when there is no offset.

I've fixed the problem like this:

=========
     DBG ("\n + Position: %d\n + Offset: (%d, %d)",
          priv->screen_position, priv->xoffset, priv->yoffset);

-    gtk_window_move (GTK_WINDOW (panel), x, y);
+    if (xoffset == 0 && yoffset == 0)
+       gtk_window_move (GTK_WINDOW (panel), x, y);
+    else
+       gtk_window_move (GTK_WINDOW (panel), xoffset, yoffset);

     _set_struts (panel, xmon, x, y, req.width, req.height);
=========

This works on 1 monitor, but i don't know if it gives strange behaviours on dual
screen. It's at least something to think about.

Reproducible: Always
Steps to Reproduce:
Comment 1 Jasper Huijsmans editbugs 2006-02-28 20:36:09 CET
Actually, I can't seem to reproduce this. On the other hand, I can't remember
why I call the panel_set_position() function from panel_init_position(), but
when I don't I get very big panels, so there are probably a lot of timing issues
involved with lots of nice potential race conditions.

Startup and sizing code of the panel has always been a problem. It is somehow
very difficult to get right, although the decision to have fixed position panel
has improved things a lot.

Anyway, a lot of words to tell you that I have no idea what is going on, but I'm
sure there are bugs in that code.

Now, about your suggested solution, the strange thing is that a few lines above
the offsets are added to x and y for normal width panels, so it should not make
a  difference at all. Perhaps something strange is going on with the width setting?
Comment 2 Jasper Huijsmans editbugs 2006-03-13 20:36:36 CET
Ok, the code was (and probably still is) a bit of a mess, but I think this issue
might be fixed with revision 20398. Please reopen if it isn't.

Bug #1480

Reported by:
Nick Schermer
Reported on: 2006-02-19
Last modified on: 2010-11-20

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Attachments

Additional information