! 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 !
Position of maximized windows is wrong if window scaling is set to "x2"
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
General

Comments

Description Niccolo Brogi 2018-01-11 01:03:32 CET
I'm using XFCE 4.13 components on Ubuntu MinimalCD 18.04.

The latest version of xfwm4  doesn't take into consideration window scaling at 2x, and when you maximize windows they go behind the panel(s), since xfwm thinks they're half the size.

To reproduce, set window scaling to 2x and try to maximize a window.

Might also be a xfce4-panel bug declaring it's half its actual size, not sure how the implementation looks like.
Comment 1 Olivier Fourdan editbugs 2018-01-11 14:20:22 CET
Could you attach a screenshot of the issue please?
Comment 2 Olivier Fourdan editbugs 2018-01-11 15:16:46 CET
Actually, it's a panel bug, the partial struts set by xfce4-panel when GDK_SCALE=2 are completely wrong.
Comment 3 Niccolo Brogi 2018-01-11 16:48:43 CET
Created attachment 7530 
Screenshot of problem

I'm on my cell and have not installed anything to take a screenshot, but I was able to take a picture.
Comment 4 Niccolo Brogi 2018-01-11 16:50:09 CET
@fourdan: I have attached a screenshot. Should I change the title of the bug (I guess so)?
Comment 5 Jason Zaman 2018-04-20 17:44:22 CEST
Created attachment 7673 
0001-panel-port-to-GdkDisplay-GdkMonitor.patch

I ported everything in panel/ to use GdkDisplay and GdkMonitor, it fixes the struts too when scaling.

A few of the external plugins dont scale properly but I think those are still on gtk2.

Author: Jason Zaman <jason at perfinion.com>
Date:   Mon Apr 16 01:15:32 2018

    panel: port to GdkDisplay & GdkMonitor
    
    GdkScreen is deprecated since Gdk 3.22. Should use GdkDisplay or
    GdkMonitor instead. Also there is only ever one GdkScreen per
    GdkDisplay. Can have many GdkMonitors tho.
    
    Bug: https://bugzilla.xfce.org/show_bug.cgi?id=14155
    Signed-off-by: Jason Zaman <jason at perfinion.com>
Comment 6 Niccolo Brogi 2018-04-20 23:45:16 CEST
Very nice.

How to apply the patch? Is it in some repo..?

Thanks!
Comment 7 Jason Zaman 2018-04-21 08:59:34 CEST
@Niccolo, i attached it to the comment above (or on the right bar). it applies on top of xfce4-panel master branch. more testing would be great especially if you have a HiDPI monitor :)
Comment 8 Alistair Buxton 2018-04-22 23:48:21 CEST
+              name = g_strdup(gdk_monitor_get_model (monitor));
               if (panel_str_is_empty (name))
                 {
-                  g_free (name);
-

gdk_monitor_get_model is transfer:none, ie you don't need to free what it returns.

However, you strdup it, so you do still have to free the result of that, in the case that the string is "" at least.

In general I like the idea of cleaning up the monitor/plug/screen number stuff. It's been a problem for a while, eg https://bugzilla.xfce.org/show_bug.cgi?id=10725#c13
Comment 9 Niccolo Brogi 2018-04-23 00:03:13 CEST
@Jason: yes, I figured it out eventually, it was confusing on mobile since Bugzilla is barely usable (on landscape, totally broken on portrait).

I've been using your patched version for a few days, and I have noticed no problems. It works great!

I think it would help a lot if Xfce's repo on GitHub accepted pull requests, though. As much as people might dislike GitHub for phylosophical reasons, it works about 1000 times better than Bugzilla, and would make it a lot easier to collaborate.
Comment 10 Jason Zaman 2018-04-24 07:00:12 CEST
(In reply to Alistair Buxton from comment #8)
> However, you strdup it, so you do still have to free the result of that, in
> the case that the string is "" at least.

Oops, good catch, fixed. yeah i removed the free first then i realized with the rest of the code it was easier to just strdup it but then forgot the free() :(.

> In general I like the idea of cleaning up the monitor/plug/screen number
> stuff. It's been a problem for a while, eg
> https://bugzilla.xfce.org/show_bug.cgi?id=10725#c13

Yeah there is still some more work to do, I fixed everything in panel/.
There are a few in libxfce4panel/ that i tried to clean up but not worth it since it still needs to support gtk2 for the compat wrapper for now. They are easy to fix but you'd need a ton of ifdef gtk3 everywhere so it can wait.

There are still a couple issues in plugins/ that I have not gotten to yet. The main ones are tasklist and systray. they dont appear to cause problems tho even in scale=2 mode. My main motivation for the panel/ GdkScreen->GdkMonitor was that i needed the struts fixed and didnt want to do a hack job so i cleaned up the whole dir.

There are some issues with external plugins that are still using gtk2 but dont scale right that need fixing too. the ones I use are systemload-plugin and netload-plugin.


(In reply to Niccolo Brogi from comment #9)
> I've been using your patched version for a few days, and I have noticed no
> problems. It works great!
> 
> I think it would help a lot if Xfce's repo on GitHub accepted pull requests,
> though. As much as people might dislike GitHub for phylosophical reasons, it
> works about 1000 times better than Bugzilla, and would make it a lot easier
> to collaborate.

I fixed up the strdup/free issue and split into many smaller patches here:
https://github.com/perfinion/xfce4-panel/commits/monitor

The issue with github is that their main repos are at git.xfce.org. they could do like we do in gentoo and allow PR's just the devs dont use the auto merge button but git fetch github pull/1234/head; git merge FETCH_HEAD then push to the main repo.
Comment 11 Paul Menzel 2018-05-29 15:13:32 CEST
That attached patch fixed the problem for me too.
Comment 12 Niccolo Brogi 2018-05-29 16:02:58 CEST
Patch works great.

There are still problem with multiple monitors: when a bottom panel is on the primary display, its size is not taken into account.
Comment 13 Jason Zaman 2018-05-30 08:56:06 CEST
(In reply to Niccolo Brogi from comment #12)
> There are still problem with multiple monitors: when a bottom panel is on
> the primary display, its size is not taken into account.

Can you explain more?
I have dual monitors (4k on the left as primary monitor, and 1080p on the right). I use the patches i submitted to bug 14346 to make the 1080p double so they line up the same.

I have top and bottom panels on the left monitor and none on the right and the struts work fine when i maximise stuff. Do you mean some other size?

If you see problems with some of the panel plugins only taking up a quarter of the size they should, I submitted some PRs to fix GtkSockets:
https://gitlab.gnome.org/GNOME/gtk/merge_requests/164
https://gitlab.gnome.org/GNOME/gtk/merge_requests/165
Comment 14 Paul Menzel 2018-05-31 14:45:34 CEST
(In reply to Jason Zaman from comment #13)

[…]

> If you see problems with some of the panel plugins only taking up a quarter
> of the size they should, I submitted some PRs to fix GtkSockets:
> https://gitlab.gnome.org/GNOME/gtk/merge_requests/164
> https://gitlab.gnome.org/GNOME/gtk/merge_requests/165

Thank you. I applied your patch on top of GTK+ 3.22.30, and it fixed the issue for me.

See bug 14424 [1] for a small glitch with xfce4-terminal.

[1]: https://bugzilla.xfce.org/show_bug.cgi?id=14424
Comment 15 Simon Steinbeiss editbugs 2018-06-06 01:00:00 CEST
Should now be fixed in git master.

Bug #14155

Reported by:
Niccolo Brogi
Reported on: 2018-01-11
Last modified on: 2018-06-06

People

Assignee:
Nick Schermer
CC List:
4 users

Version

Version:
Unspecified

Attachments

Screenshot of problem (35 bytes, text/plain)
2018-01-11 16:48 CET , Niccolo Brogi
no flags
0001-panel-port-to-GdkDisplay-GdkMonitor.patch (26.66 KB, patch)
2018-04-20 17:44 CEST , Jason Zaman
no flags

Additional information