Skip to content
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

Windows requesting decorations get double decorations #244

Closed
aggalex opened this issue May 7, 2018 · 46 comments · Fixed by elementary/default-settings#103
Closed

Windows requesting decorations get double decorations #244

aggalex opened this issue May 7, 2018 · 46 comments · Fixed by elementary/default-settings#103
Labels
Priority: Low On the radar, but not the most urgent thing Status: Confirmed Verified by someone other than the reporter

Comments

@aggalex
Copy link

aggalex commented May 7, 2018

When I ran PlayOnLinux on elementary OS Juno build I have I noticed gala givesit two decorations: one normally and one around the whole window, including the shadows. It is really ugly, and don't know if it applies to other apps.

screenshot from 2018-05-07 08 47 22

PS: Tried to see if other apps have the same problem, mainly non GTK3 apps, but the ones I tried (LibreOffice, VLC & "about XFCE4" that I found in the appcenter) don't have such problems. I believe it has to do with the too-small-default-sized window of it, thus making gala think elements go out of it and thus making gala think it needs another decoration for it as a second widget border. You can see how the list widget on the "PlayOnLinux Install menu" overlaps the it's parent window.

screenshot from 2018-05-07 09 12 44


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@davidmhewitt davidmhewitt added the Status: Confirmed Verified by someone other than the reporter label May 7, 2018
@davidmhewitt
Copy link
Member

I can confirm this, although I'm not sure whether it's a gala issue, a stylesheet issue or an issue with the applications themselves.

The further information I can add is that this seems to affect wxPython applications. For example, you can run the wxPython "Hello, World" application from their website and see the same effect: https://www.wxpython.org/pages/overview/#hello-world

@aggalex
Copy link
Author

aggalex commented May 7, 2018

Perhaps there is a way to patch it around, after all that problem didn't exist on Loki.

Edit: As I said earlier, widgets tend to pop out of the parent window in PlayOnLinux, and seems like this is also the case with wxPython apps, since they also have the same problems. To confirm my assumption I will try to make a wxPython app with something very long that violates the window's boundaries, and see if the second boundary gala applies will cut the widget. If yes, then my assumption is correct, and this might be an interesting clue for you. Will do when I find the time.

EDIT: It's been quite a while and I can't seem to find sufficient time to try this. I think I'll call this off.

@lsrzj
Copy link

lsrzj commented Jul 16, 2018

Not only POL, MySQL Workbench too, and with the latest version, I'm using Loki from a clean installation. And it always happen in child windows, not on main windows.

captura de tela de 2018-07-12 10-56-27

@davidmhewitt
Copy link
Member

Further information on this:
I can also reproduce this issue in Eclipse IDE, only with child windows like the above comment about MySQL workbench.

I've done some testing and ruled out the elementary stylesheet by running both Ubuntu Budgie and Ubuntu GNOME (both 18.04) and using the elementary stylesheet. In these cases, the issue cannot be reproduced. So it's something in the window manager or desktop environment.

The MySQL workbench case is interesting though, as I think that's a native GTK3 app, so I'll have to do a bit more digging into that one and see if there's anything obvious there.

@apellizcos

This comment has been minimized.

@cmcgarry
Copy link

I'm seeing this issue with Juno now since recently doing a clean install. Used to run Playonlinux on Loki just fine. Any suggestions?

@rwoolf
Copy link
Sponsor

rwoolf commented Oct 30, 2018

I'm noticing the same problem with POL and Eclipse on Juno. It seems there is a high percentage of apps that have this problem. With POL it makes the app non functional.

@davidmhewitt
Copy link
Member

Found out some more information on this today. The affected applications are requesting extra window decorations via legacy Motif Window Manager hints. It's possible to build a Vala/GTK3 sample that reproduces the issue with the following code:

public class Application : Gtk.Window {
	public Application () {
		window_position = Gtk.WindowPosition.CENTER;
		set_default_size (350, 70);

		realize.connect (() => {
			get_window ().set_decorations (Gdk.WMDecoration.ALL);
		});
	}

	public static int main (string[] args) {
		Gtk.init (ref args);

		Application app = new Application ();
		app.show_all ();
		Gtk.main ();
		return 0;
	}
}

Still need to figure out why Gala does stuff with these when GNOME shell and Budgie don't.

@Jiab77
Copy link

Jiab77 commented Nov 3, 2018

Same issue using the BOINC Manager Application.

I guess it also use wxPython.

@Jiab77
Copy link

Jiab77 commented Nov 3, 2018

There is another open issue concerning the same problem: #299

@Jiab77
Copy link

Jiab77 commented Nov 4, 2018

@davidmhewitt Loki is not impacted. So by comparing changes done you should be able to see what's causing this issue?

@MichelFrade
Copy link

MichelFrade commented Nov 5, 2018

Same issue using Dbeaver 5.2.4 (version 5.2.3 OK), Eclipse and Play on Linux.

@cassidyjames cassidyjames changed the title PlayOnLinux window get double decorations Windows requesting decorations get double decorations Nov 12, 2018
@cassidyjames cassidyjames added the Priority: Low On the radar, but not the most urgent thing label Nov 12, 2018
@davidmhewitt
Copy link
Member

davidmhewitt commented Nov 13, 2018

Some further information:
This does not appear to be caused by Gala. The previous testing I've done with GNOME shell and Budgie have been under Ubuntu GNOME and Ubuntu Budgie respectively, and windows do not get double decorations there.

However, if you install and run a GNOME session on elementary (still using the stylesheet and config, etc...), you still get the double decorations. I even installed an unpatched version of mutter and this still happens.

So it would appear that the issue lives in some config or other patched packages rather than Gala itself, as it can be reproduced with vanilla Mutter running on elementary.

@Jiab77
Copy link

Jiab77 commented Nov 13, 2018

@davidmhewitt The issue was also present in the beta versions of Juno. So I think it was introduced again during the development of Juno. I never had this issue while running Loki. Same goes with GNOME Shell as you said, I didn't had this issue too.

@davidmhewitt
Copy link
Member

davidmhewitt commented Nov 13, 2018

Okay, found the cause.

There's a shell script (/etc/profile.d/gtk-csd.sh) that exports GTK_CSD=1. I would highly recommend not deleting this shell script as it makes all of the dialog boxes look a bit weird and breaks the open file/folder dialog in some cases.

But, if you have an application that's experiencing this issue, run it with GTK_CSD=0 name-of-double-decorations-app, and this should resolve the issue. (e.g. GTK_CSD=0 eclipse)

davidmhewitt added a commit to elementary/default-settings that referenced this issue Nov 13, 2018
This is the cause of elementary/gala#244 

Can anyone remember why this is still here and what issues removing it would cause?
@MichelFrade
Copy link

Other software I use at work has presented this problem. SmartSVN

captura de tela de 2018-12-05 11-19-50

@megatux
Copy link
Sponsor

megatux commented Dec 11, 2018

PlayOnLinux, smartsvn, Eclipse, dbeaver are all Java apps and, if I'm not wrong, using the same graphics toolkit, SWT (that uses Gtk+ in Linux). I think the problem lies there.

@megatux
Copy link
Sponsor

megatux commented Dec 11, 2018

Could Gala check if the app is using CSD api? maybe some window property, like the ones listed with xprop command?. e.g running dbeaver with & without GTK_CSD=0, respectively, gives me differences
captura realizada el 2018-12-11 18 54 15

@davidmhewitt
Copy link
Member

As I have written above, this is not caused by Gala, and trying to do anything in Gala to fix this would be really hacky if not impossible.

Fixing this involves patching GTK.

In vanilla GNOME, dialogs are coded to have CSD by default because they want put the action buttons in the headerbar (e.g. in the save dialog, the save button is in the top right of the window, in the titlebar). However, when you change the GTK setting that stops them from being in the headerbar (because this doesn't meet elementary UI guidelines), dialog windows become server side decorated by default, this is hardcoded into GTK.

So, to enforce CSD on dialogs, elementary exports GTK_CSD=1 in the session, and either GTK or Mutter doesn't handle this well.

@megatux
Copy link
Sponsor

megatux commented Dec 13, 2018

I'm not sure if I follow you but if there is no way to have both apps with AND without CSD at the same time, for the same GTK 3.x version then I think it's a bug that should be fixed. I assume there is an open GTK issue for this.

@a-tokarev
Copy link

a-tokarev commented May 13, 2019

I have this issue in DisplayCAL calibration software. I have reported it to the developer. His reply was:

Hi,
not fixable by me:

#!/usr/bin/env python2
import wx
app = wx.App(0)
f = wx.Frame(None)
f.Show()
app.MainLoop()

Please report upstream to python-wxgtk3.0 package.

@ajkr195
Copy link

ajkr195 commented May 21, 2019

So there is no possibility of its fix with regular updates?

@yozachar
Copy link

yozachar commented Jun 4, 2019

Thanks @davidmhewitt for the workaround
For those wondering how to change the .desktop file appropriately, set:
Exec=env GTK_CSD=0 <executable path>
For example for Eclipse I did this:
Exec=env GTK_CSD=0 /opt/eclipse/eclipse

Worked in eOS 5.0 Juno

PlayOnLinux Modified Desktop Entry

[Desktop Entry]
Version=1.0
Name=PlayOnLinux
Comment=Front-end application for the wine
Type=Application
Exec=env GTK_CSD=0 playonlinux %F
Icon=playonlinux
Categories=Utility;Emulator;

@cmcgarry
Copy link

cmcgarry commented Jun 5, 2019

This worked for me as well. Finally, PlayOnLinux without the extra window.

Thank you!

Thanks @davidmhewitt for the workaround
For those wondering how to change the .desktop file appropriately, set:
Exec=env GTK_CSD=0 <executable path>
For example for Eclipse I did this:
Exec=env GTK_CSD=0 /opt/eclipse/eclipse

Worked in eOS 5.0 Juno

PlayOnLinux Modified Desktop Entry

[Desktop Entry]
Version=1.0
Name=PlayOnLinux
Comment=Front-end application for the wine
Type=Application
Exec=env GTK_CSD=0 playonlinux %F
Icon=playonlinux
Categories=Utility;Emulator;

@Akryum
Copy link

Akryum commented Jul 19, 2019

Just to report it's still an issue on DBeaver, making it unusable (some buttons on dialogs are hidden no matter the size of the window).

@aggalex
Copy link
Author

aggalex commented Jul 19, 2019

@Akryum you can use the suggested workaround:
add env GTK_CSD=0 before everything else inside the exec entry inside DBeaver's application file, which is inside /usr/share/applications

So, eg: Exec=blahblah %U should become Exec=env GTK_CSD=0 blahblah %U. Make sure to change blahblah %U with whatever the Exec entry had before you edited it.

@Akryum
Copy link

Akryum commented Jul 19, 2019

Yeah I did that, but still just a workaround :(

@aggalex
Copy link
Author

aggalex commented Jul 19, 2019

@Akryum better than nothing. Bear with, it at least for now. I've done this with POL, and didn't have to do anything else ever since, so I don't think it's such an annoying workaround.

@Akryum
Copy link

Akryum commented Jul 26, 2019

It's pretty annoying, since I have to do it again every time I update DBeaver 😓

@Akryum
Copy link

Akryum commented Jul 26, 2019

I have just hit another issue: with the env GTK_CSD=0 workaround, DBeaver can't open System's File select dialog. For example, I tried executing a huge SQL script on a database:

Screenshot from 2019-07-26 12-27-21

The folder icon does nothing when I add env GTK_CSD=0 to launch DBeaver, but it opens the file select dialog when I don't use the workaround -- the DBeaver dialog still being unusable because the action buttons are below the visible area of the dialog.

Is there anything else I can try?

worldofpeace added a commit to worldofpeace/nixpkgs that referenced this issue Aug 5, 2019
Causes various issues when not set
* elementary/files#971
* elementary/default-settings#103
* cassidyjames/ideogram#26

However this can cause certain problems in gala
* elementary/gala#244
@amrit9193
Copy link

I am not a developer, just a regular user using Hera recently upgraded from Juno. I am seeing this problem for Veracrypt and Youtube-dl-gui. Both these program show the following when started form terminal.

***** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug**

\I have also recently used pop OS! and this problem doesn't appear there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low On the radar, but not the most urgent thing Status: Confirmed Verified by someone other than the reporter
Projects
None yet
Development

Successfully merging a pull request may close this issue.