! 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 !
please support mwm hints completely
Status:
RESOLVED: WONTFIX
Component:
Decorations

Comments

Description Matthias Clasen 2014-01-13 20:40:02 CET
Created attachment 5313 
screenshot

GTK+ uses mwm hints to implement client-side decorations and custom titlebars. In particular, we are asking for a border, but no titlebar. xfwm4 is so far the only window manager I've come across that supports mwm hints, but not this combination. Please consider supporting this. See the screenshot for the current, suboptimal user experience.
Comment 1 Alistair Buxton 2014-01-16 20:18:04 CET
I've implemented support for this, the branch is available here:

https://github.com/ali1234/xfwm4/tree/mwm2

It's a series of patches, as I had to change quite a few things.
Comment 2 Alistair Buxton 2014-01-16 20:21:43 CET
Created attachment 5316 
How it looks now
Comment 3 Robert Roth 2014-01-18 09:44:48 CET
Great to see this, that was quite fast :) I have checked the last 5 commits, as I guess those are related, and looks OK.
Comment 4 ale.carrazzoni 2014-04-12 04:13:58 CEST
Sorry for asking but why aren't those patches in git master yet? With Gtk+ 3.12 there are already a lot of CSD modal dialogs in most GTK+ 3 apps.
Comment 5 Olivier Fourdan editbugs 2014-04-14 16:12:07 CEST
My laptop's dead again, someone else needs to review/push the patch..
Comment 6 Olivier Fourdan editbugs 2014-04-14 18:07:33 CEST
I can't say I'm thrilled by the fact that the patch requires new decorations (not willing to redo all the themes).

But more importantly I reckon GTK+ is doing it wrong TBH, not only by relying on a 20 year old spec to implement client-side decorations, but also by not doing client side decoration fully and still asking for the WM to draw the borders.

Either the decorations are done by the client, all of the decorations and not just the title bar, or else the WM does it.
Comment 7 Alistair Buxton 2014-04-14 18:09:42 CEST
The patch does not require any new decorations. It can reuse the existing ones by flipping the bottom border pixmaps and drawing them at the top. This happens if the new decorations are missing. Adding new decorations is therefore optional for theme designers.

I agree that Gtk+ is doing it wrong.
Comment 8 Alistair Buxton 2014-04-14 21:39:12 CEST
Also I moved the patches on to Xfce user repository:

http://git.xfce.org/users/ajb/xfwm4/log/?h=mwm
Comment 9 Olivier Fourdan editbugs 2014-04-16 09:23:18 CEST
(In reply to Alistair Buxton from comment #7)
> The patch does not require any new decorations. It can reuse the existing
> ones by flipping the bottom border pixmaps and drawing them at the top. This
> happens if the new decorations are missing. Adding new decorations is
> therefore optional for theme designers.


Reusing, flipping, modifying existing themes pixmaps is a dead end, there's no way this can work reliably with most themes out there.

I think for this particular case we should use a generic, unthemable minimalist decoration. Even a flat window without pixmap would do.
Comment 10 Alistair Buxton 2014-04-16 10:03:29 CEST
On the contrary, it works with all the xfwm default themes, all the themes shipped by default on ubuntu, and the top 10 most popular and most downloaded themes on xfce-look. In fact I cannot find a single theme it doesn't work with.
Comment 11 Olivier Fourdan editbugs 2014-04-16 17:11:52 CEST
(In reply to Alistair Buxton from comment #10)
> On the contrary, it works with all the xfwm default themes, all the themes
> shipped by default on ubuntu, and the top 10 most popular and most
> downloaded themes on xfce-look. In fact I cannot find a single theme it
> doesn't work with.

Unfortunately, it works with all the themes in Ubuntu is quite irrelevant here, can you show me a screenshot with the theme "R9X" for example?

Note importantly, most themes borders reflect a Northwest light source, flipping pixmaps will break that visually (the devil's always in the details).

That's why I would really  prefer a much robust yet simple implementation in the sense of an unthemeable thin border for apps that specify border without title in MWM hints.
Comment 12 Alistair Buxton 2014-04-16 17:25:41 CEST
Created attachment 5434 
r9x

To me this looks fine. It's certainly better looking than an unthemable border, which will look bad with any theme. I think the only way this could look any better is by redo'ing the theme.
Comment 13 Alistair Buxton 2014-04-16 17:27:04 CEST
Also it is doubly-irrelevant for Ubuntu, because Ubuntu patched out headerbars from *everything* already. So we don't even need this patch.
Comment 14 Olivier Fourdan editbugs 2014-04-16 17:42:03 CEST
That does look bad, shadows are upside down.

Seriously, not sure what you mean about Ubuntu patches, but flipping pixmaps is no-go with me.
Comment 15 ale.carrazzoni 2014-04-16 20:19:14 CEST
Please at least don't make the top borders unthemable, then nobody would update the themes so the work.
Comment 16 Olivier Fourdan editbugs 2014-04-16 21:12:19 CEST
(In reply to ale.carrazzoni from comment #15)
> Please at least don't make the top borders unthemable, then nobody would
> update the themes so the work.

Client-side decorations means the client app manages the decorations.

All I'm saying is I see no point in doing dirty tricks to try to reuse the existing border pixmaps that will look wrong and out of the place anyway.
Comment 17 Matthias Clasen 2014-04-16 22:39:25 CEST
Not sure I agree that mwm hints being 20 years old is a valid excuse for not supporting them fully, or that GTK+ is somehow in the wrong for using them.

But anyway, if you use GTK+ 3.12.1, you will actually get full csd decorations under xfwm4, aas long as compositing is enabled. I have taken out the check for _GTK_FRAME_EXTENTS support, which means that the shadow and invisible border will be treated as part of the window. Thats mainly noticable during interactive move or resize. But no more double titlebars.

So, just turn on compositing.
Comment 18 ale.carrazzoni 2014-04-16 23:24:18 CEST
Unfortunately not everyone can use compositing. I use compton instead of the xfwm compositor because otherwise JDownloader creates annoying artifacts on the top left corner. Also, the user shouldn't have to turn on an optional feature to make xfwm work properly with CSD.
Comment 19 Alistair Buxton 2014-04-16 23:32:18 CEST
(In reply to ale.carrazzoni from comment #18)
> JDownloader creates annoying artifacts on the top left corner

Disable the JDownloader tray icon. This is https://bugzilla.xfce.org/show_bug.cgi?id=10620
Comment 20 scar 2014-04-18 14:23:39 CEST
Is there any way to get around the app's client-side decoration and to use only the native WM's decorator?
Comment 21 Guido Berhoerster 2014-04-28 19:45:04 CEST
I think that although CSD might be a good fit for GNOME they are problematic in Xfce for various well-known reasons:

* CSD look out of place in a heterogeneous application environment (which is much more likely for Xfce than GNOME or KDE users since Xfce does not have such a broad range of "native" applications) where windows of applications using different toolkits such as GTK2 (most of Xfce for the time being), Qt, or Java are combined

* xfwm4 has the ability to forcibly close windows of hung applications which is impossible with CSD and they cannot even be moved

* xfwm4 allows to roll up a window, show a window on all workspaces or always keep it on the top layer, all of which is impossible with CSD

* xfwm4 allows to customize the buttons shown in the titlebar, e.g. a button for pinng or rolling up windows, all of which is lost with CSD and leads to inconsistencies because such buttons are not even supported

* xfwm4 allows to customize mouse actions on top of the window decorations such as double-clicking the title-bar or rolling up the window with the mouse-wheel, all of which is impossible with CSD

Thus, CSD are IMO generally undesirable and unsuitable for Xfce and the above patch should not be merged. Rather, and not only because this affects Xfce but also setups which only use a window manager without a complete DE, or more importantly KDE, I think it is not unreasonable for asking the Gtk side to add a setting for disabling CSD. By that I mean not drawing its own border and hiding client window controls and disabling the MWM hints that disable the window manager's decorations. From reading about CSD on Matthias blog I figure that it is currently only possible to change the order of client side window controls and their appearance on dialog windows.

Matthias, could you implement something like that as an xsetting? Our xfsettingsd could then use that setting to disable CSD by default when running an Xfce session.
Comment 22 ale.carrazzoni 2014-05-03 18:27:19 CEST
Since GTK+ has removed a lot of settings later I wouldn't trust them to add a setting for us.

Alistair: I really need JDownloader in the tray area. I'd like to fix that bug in Xfwm but sadly I don't know how X Window Managers work.
Comment 23 Martin Gräßlin 2014-05-09 07:31:55 CEST
> xfwm4 is so far the only window manager I've come across that supports mwm hints, but not this combination. 

Just for the record: KWin doesn't support this combination, either (see https://bugzilla.gnome.org/show_bug.cgi?id=729769) and our investigation showed that there are lots more window managers not supporting it. In KWin we are not going to add support for this as it cannot be implemented in a way that ensures that the decoration doesn't draw it. As MWM hints do not allow the WM to tell what it supports, it doesn't make much sense to invest time in a solution which would be incomplete from the start.
Comment 24 ale.carrazzoni 2014-05-12 00:37:34 CEST
So it should be fixed in GTK+ then?
Comment 25 Olivier Fourdan editbugs 2014-05-12 10:02:13 CEST
(In reply to ale.carrazzoni from comment #24)
> So it should be fixed in GTK+ then?

The bug is valid and we /{c,s}hould/ support the hints, I just find unfortunate that GTK+ relies on such a mechanism.

Anyhow, as we have a patch ready thanks to Alistair, I agree that patch should be merged.
Comment 26 Guido Berhoerster 2014-05-12 10:42:17 CEST
(In reply to Olivier Fourdan from comment #25)
> (In reply to ale.carrazzoni from comment #24)
> > So it should be fixed in GTK+ then?
> 
> ... I just find
> unfortunate that GTK+ relies on such a mechanism.

Exactly, so if you merge it, can you for this reason please add a wm tweak setting to enforce window decorations, i.e. keep the status quo?

> Anyhow, as we have a patch ready thanks to Alistair, I agree that patch
> should be merged.

So what about the theming issue, do you wan to go with the flipped pixmaps? You also didn't comment on the issue Martin raised?

@Matthias:
Could give some feedback on a possible solution from the GTK side for non-GNOME environments where CSDs doe not fit well, especially my suggestion in comment#21? If needed I can also open a RFE on the GTK bugtracker to discuss this further.
Comment 27 ale.carrazzoni 2014-05-16 02:24:42 CEST
(In reply to Matthias Clasen from comment #17)
> Not sure I agree that mwm hints being 20 years old is a valid excuse for not
> supporting them fully, or that GTK+ is somehow in the wrong for using them.
> 
> But anyway, if you use GTK+ 3.12.1, you will actually get full csd
> decorations under xfwm4, aas long as compositing is enabled. I have taken
> out the check for _GTK_FRAME_EXTENTS support, which means that the shadow
> and invisible border will be treated as part of the window. Thats mainly
> noticable during interactive move or resize. But no more double titlebars.
> 
> So, just turn on compositing.

Great, now tiling is broken when compositing is turned on. It's even worse when using compton since you have a double shadow. Can't you just draw a window properly?
Comment 28 Olivier Fourdan editbugs 2014-05-16 06:50:11 CEST
(In reply to ale.carrazzoni from comment #27)

> Great, now tiling is broken when compositing is turned on.

Unrelated to this current bug, please don't confuse things even more with this current issue.

> It's even worse
> when using compton since you have a double shadow. Can't you just draw a
> window properly?

If you are using Compton, it's a bug in Compton, not in Xfce nor in GTK+. 

But again, this is unrelated to the current issue, such comment just keep adding noise to an already fairly long bug which should be fairly straightforward:

 - Xfce does not support some combination of MWM hints
 - that was on purposed as I reckoned those should not be needed
 - we have now a patch, do we merge it or does it need rework before being merged.
Comment 29 Mike Gelfand 2014-06-17 21:24:50 CEST
I tend to agree with comment#21. Even if you merge the change, please support a way of enforcing normal decorations and turning CSD off. This stuff may look [questionably] good in Gnome, but I would never want to see it in Xfce. I would hate to realize I switched from Gnome 3 to Xfce just to find myself in the same place UX-wise a few years later.
Comment 30 oleid 2014-06-24 11:59:15 CEST
Just for the record: The following bug is a collection of all issues with GTK's CSD:
https://bugzilla.gnome.org/show_bug.cgi?id=729721

Martin proposed a IMHO useful plan for handling CSD outside GNOME there.
Comment 31 ale.carrazzoni 2014-09-25 23:29:51 CEST
In GTK+ 3.14 about boxes and settings screens now have normal decorations but apps that use CSD (Evince and baobab at least) are still broken when compositing is turned off.
Comment 32 Olivier Fourdan editbugs 2015-05-20 21:12:17 CEST
Fixed in gtk instead.

Bug #10631

Reported by:
Matthias Clasen
Reported on: 2014-01-13
Last modified on: 2015-05-20

People

Assignee:
Olivier Fourdan
CC List:
11 users

Version

Version:
unspecified

Attachments

screenshot (21.69 KB, image/png)
2014-01-13 20:40 CET , Matthias Clasen
no flags
How it looks now (44.74 KB, image/png)
2014-01-16 20:21 CET , Alistair Buxton
no flags
r9x (137.03 KB, image/png)
2014-04-16 17:25 CEST , Alistair Buxton
no flags

Additional information