-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wnck-pager: update workspace switcher aspect ratio #1417
Conversation
When building the panel out-of-process issue #797 doesn't exists \o/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this in-process only, got these results:
This does solve the switcher aspect ratio problem but on a nonexpanded panel makes the window list disappear entirely, and changing themes didn't fix that. Space is allocated for normally for each button but they are not rendered and that space is treated as bare panel when clicking on it.
If I put the window list on a nonexpanded panel and look at it with GtkInspector, the widgets for the window list are all there, they are just not shown. Wonder if we are just not showing them when not expanded due to a codepath missing something like gtk_widget_show_all()?
Using |
Also, on restarting the panel, the window list on a nonexpanded in-process panel appears for a fraction of a second before disappearing when the panel is rerendered, possibly for the first time. |
This only fixes the workspace selector aspect ration in-process, right? For the non-expanded issue, there seem to be a problem in the diff --git a/mate-panel/panel-widget.c b/mate-panel/panel-widget.c
index 665fdfab..95016be1 100644
--- a/mate-panel/panel-widget.c
+++ b/mate-panel/panel-widget.c
@@ -1514,7 +1514,7 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
else
panel->size = allocation->height;
- if (panel->packed) {
+ if (FALSE /*panel->packed*/) {
/* we're assuming the order is the same as the one that was
* in size_request() */
int applet_using_hint_index = 0; then it mostly works -- yet I don't know the actual implications. But it's clearly not perfect, as it'll allocate take the expected room for the applets, not taking into account their position: e.g. if you put the tasklist on the far right of an unexpanded panel, the panel will be sized as if it was visible, but it's actually basically invisible because it has 0 room before the end of the panel. I expect the actual issue being a problem computing the minimal size given to the applet when allocating the child, although it seems to be computing the size correctly when it sizes the panel.
That would indeed be a gross hack, but well, I don't think we're pass that just yet. Unfortunately, it doesn't seem to work; if I apply the following it doesn't help (possibly it's not set early enough): diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 0830569f..5c604fe6 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1138,7 +1138,7 @@ mate_panel_applet_get_request_mode (GtkWidget *widget)
priv = mate_panel_applet_get_instance_private (applet);
- if (priv->out_of_process)
+ if (priv->out_of_process || priv->flags & MATE_PANEL_APPLET_EXPAND_MAJOR)
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
orientation = mate_panel_applet_get_orient (applet); Another workaround could be try the intermediate wrapper for the desktop switcher that Alberts pasted somewhere in one of those reference issues. I didn't try it, but if he says it works, I'm pretty sure it does; and it's a more localized hack. Of course, the best fix would be to figure out where the layout code is messing up… but that code is far from trivial. |
Yes, this is your code from mate-desktop-legacy-archive/libmatewnck#4 (comment) |
Just tested using
and yes, that gives me both a (semi-) functional window list on a non-expanded panel (looking at it right now) and the proper workspace aspect ratio. unfortunately, if I started opening a lot of new windows to use more space after putting the classic menu to the right of the window list to use up some space, the space needed for the buttons was allocated right of the classic menu applet, and the entire window list moved right too, compressing existing buttons and pulling the whole panel end to the right too. I doublechecked that in the nonexpanded panel, the "packed" case is what's normally used by removing that block entirely, again getting the above results with only the "not packed" case available in the code. This confirms that whatever is allocating zero space to show the buttons after expanding the panel to take them is in or affected by that block of code. Note the comment in the code:
|
This block starting at line 1537 in panel-widget.c I just proved to be the problem
challoc.width is somehow coming up as zero, if I replace EDIT: I have proven If I replace MIN with MAX I get huge window buttons, if I use This is the horizontal panel case only of course, and is restricted to the window list on a packed panel. We need to find out why |
Also note that you left the additional These are good for debugging but log spam for users if they get to git master or to a release. I used a g_message statement to prove that |
I added my own debugging code to the block in question to see what we are getting back. Making the block in question
** Message: 00:04:29.881: width =
|
I dropped the debug code blog. |
You mean that post? |
I can confirm the issue with the tray. I looked at the wrapper, only the core of the suggested code is written there. Looks like whatever we do must be limited to the switcher only |
Some of the g_print debug code is still in the latest commits, line 1453 in panel-widget.c is one example. |
Done, i removed the rest of the debug code. |
fixes #1230 This is needed because of an update in libwnck https://gitlab.gnome.org/GNOME/libwnck/-/commit/3456b747b6381f17d48629dd8fdd4d511e739b10
And all of |
Thanks,I will be playing with this over the next few days trying to find a fix that works
|
In playing with this, I've noticed something interesting: while the last icon in the tray always gets its right edge cut off, the seemingly random cutting (partial rendering in reduced space) of other icons such as the force-quit and inhibit buttons on restarting the panel is entirely stopped by this. Testing in x11 gives the results decribed above: Testing in Wayland was interesting: The last icon in the tray (an indicator both here and in x11 on my setup) was cut as in X11, but the unexpanded panel showed the window list buttons! Instead of the panel expanding to take more of them, if more than one button was to show when the panel started text was ellipsized, and the space taken by those initial buttons was all that the applet would ever get, but all of the window list buttons showed up. The backend code is totally different of course, so querying the applet's size gets different results. Also the nonexpanded panel always renders on the left side of a wayland screen |
Well, you changed the code for windows-list applet (wayland) for yourself in summer as far as i can remember. 2 xfce user did confirm that the xfce-panel crash was gone with vanilla libwnck in fedora https://bugzilla.redhat.com/show_bug.cgi?id=2242944#c5 |
Oh yeah-the wayland window list has to be complteley differenr becsuse libwnck is X11 only. Thankfully wlroots supports gtk-layer-shell which handles passing the window coordinates and name between the compositor and the panel.
Some of those icon cutting issues date all the way back to GNOME 2. If necessaey we could see distros building everything out-of-process and specialty repos (e.g old sryle Ubuntu PPA's) offering Wayland builds.
The x11 codepath is long enough that this PR mostly working in wayland only narrows things down a little. The tray icon cutting may or may not be the same issue.
|
fixes #1230 This is needed because of an update in libwnck https://gitlab.gnome.org/GNOME/libwnck/-/commit/3456b747b6381f17d48629dd8fdd4d511e739b10 With that commit applets should be build out-of-process to avoid issues with windows-list and tray applets. See #1417 for more infos. Signed-off-by: raveit65 <[email protected]>
I can provide an in-process build for wayland testers at fedora coprs cloud https://copr.fedorainfracloud.org/coprs/ |
Given just how long we have had applet cutting issues (and GNOME 2 before us) I am wondering if there is anyone left who fully understands the applet code and these two applets. |
This is a dirty hack, but it works both in-process and out-of-process, and doesn't break window list on non-expanded panels. A better solution would be to actually fix the panel's layout code, but nobody seems to have enough time and experience with this to actually do this at the moment. Based off an idea and code from Alberts Muktupāvels[^1], thanks. Fixes #1417. [^1]: #1230 (comment)
@raveit65 @lukefromdc can you give #1420 a try? It's based on the hack suggested by Alberts, and it seems to work a lot better than what we have here, as well as being contained in the pager applet. It's definitely a hack, but I'm more comfortable with a working, low-impact hack than a proper fix that doesn't really work and has unknown implications 🙂 |
I just confirmed that the changes in mate-panel-applet.c in this are themselves sufficient to kill the window list in a nonexpanded panel, while the changes in panel-widget.c are needed to fix the switcher |
Better fix merged in |
This fixes #1230
and is needed because of an update in libwnck
https://gitlab.gnome.org/GNOME/libwnck/-/commit/3456b747b6381f17d48629dd8fdd4d511e739b10
In fedora i could workaround this issue with reverting the libwnck commit.
But it seems that xfce users had problems with the xfce-panel because of reverted libwnck commit. See https://gitlab.xfce.org/xfce/xfce4-panel/-/issues/630#note_80841 and https://bugzilla.redhat.com/show_bug.cgi?id=2242944
I offered a test RPM without the mentioned patch to confirm the xfce issue.
But we should really try to fix the issue with wnck-pager from our side after 2 years. It is urgent!
As a downside this PR overwrites #806 which fixed 2 issues.
I can't reproduce #799 with PR anymore, but unfortunately #797 still exists with PR.
@mate-desktop/core-team
Please help to fix #797 on top of this PR
If we find no solution the only option is to use PR plus disable applet in-process build for fedora and all other distributions which use libwnck >= 40.