xfwm4: top border still present when window is maximized

Bug #904958 reported by Mark
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xfwm4
Fix Released
Wishlist
xfwm4 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Hi,

When a window is maximized, its borders/decoration should not be visible. With xfwm4 however, when you maximize a window its top border remains visible. But in the maximized state the top border is useless (clicking and dragging it does nothing), it just wastes screen space.

Most xfwm4 themes have very thin borders, so this issue is not very visually obvious. However with a theme that has thicker borders (e.g. the "Mofit" theme) it looks quite ugly.

I reported this bug upstream, see https://bugzilla.xfce.org/show_bug.cgi?id=7436
In the mean time, it would be good if it could be fixed in Ubuntu. I believe the fix involves adding a couple of lines to the frameTop() function in src/frame.c, like this:

int
frameTop (Client * c)
{
    TRACE ("entering frameTop");

    g_return_val_if_fail (c != NULL, 0);
    if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_BORDER)
        && !FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)
        && (!FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED) // This condition added
            || !(c->screen_info->params->borderless_maximize))) // This condition added
    {
        return c->screen_info->title[TITLE_3][ACTIVE].height;
    }
    return 0;
}

Revision history for this message
In , Mark (mark-k) wrote :

Hi,

When a window is maximized so it fills the whole screen, its top border is still shown. The top border in this state is useless though, since it cannot be dragged to resize the maximized window. So it just wastes space.

For most xfwm4 styles/themes this doesn't actually look too bad. But with a theme with relatively thick window borders it can look quite ugly. To see what I mean, change the window manager style to "Mofit" then maximize a window.

Revision history for this message
In , Mark (mark-k) wrote :

I might have found the cause of the problem.

In src/frame.c, the frameTop() definition does not have similar checks for CLIENT_FLAG_MAXIMIZED as the frameLeft(), frameRight() and frameBottom() functions.

Should the frameTop() function be changed to read something like this?

int
frameTop (Client * c)
{
    TRACE ("entering frameTop");

    g_return_val_if_fail (c != NULL, 0);
    if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_BORDER)
        && !FLAG_TEST (c->flags, CLIENT_FLAG_FULLSCREEN)
        && (!FLAG_TEST_ALL (c->flags, CLIENT_FLAG_MAXIMIZED) // This condition added
            || !(c->screen_info->params->borderless_maximize))) // This condition added
    {
        return c->screen_info->title[TITLE_3][ACTIVE].height;
    }
    return 0;
}

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

Removing the top border when maximized would break most themes, not something I would like just for a few themes such as the Motif like theme.

Not something I would fix.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Thanks for your bug report. You don't usually need to file a bug on launchpad when you've already reported it upstream.

About your request, I'm sorry, but we don't usually apply patches when the upstream developer expressed his disagreement about the bug/feature, and that's what happened here (window management is tricky, so I prefer to stick close to upstream).

Changed in xfwm4 (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
In , thesame (thesame-ml) wrote :

Add the ability to undecorate maximized windows to save vertical space on screen.

Revision history for this message
In , thesame (thesame-ml) wrote :
Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

(In reply to comment #1)
> Implemented here https://bitbucket.org/thesame/xfwm4-titleless

Please attach patches here if you want this upstream (can't really teach changes from another git repo,not convenient...)

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

Note, title-less maximization is already covered by EWMH, so this needs to be implemented via the standard, making it an unconditional option in not the right way to add this feature.

1. add support for EWMH standard for borderless maximization
2. make sure it's not just the title, but border as we'll (ie there is already an option to show or hide borders on maximization, make sure this work in any case)
3. once the feature supports the standard, we can add a user option to set the default behaviour, for apps that don't specify their desired maximization mode via the standard.

Revision history for this message
In , thesame (thesame-ml) wrote :

Created attachment 4959
Adds ability to hide titles of maximized windows

Revision history for this message
In , thesame (thesame-ml) wrote :

(In reply to comment #3)
> Note, title-less maximization is already covered by EWMH, so this needs to
> be implemented via the standard, making it an unconditional option in not
> the right way to add this feature.

I couldn't find appropriate EWMH atom to show/hide titles of maximized windows. My solution isn't unconditional, it adds new checkbox (initially unchecked) to WM tweaks.

> 1. add support for EWMH standard for borderless maximization
> 2. make sure it's not just the title, but border as we'll (ie there is
> already an option to show or hide borders on maximization, make sure this
> work in any case)

My solution covers both full and vertical titleless maximizations. I'd be glad if someone tested it with me. It works for me and I already use it.

Revision history for this message
In , Konstantin Khlebnikov (koct9i) wrote :

I have applied this to xfwm4 4.10.1 from debian/testing and it work like a charm.
Patch little bit messy, it would be better to split it into pieces.

screenshot: https://plus.google.com/105141859736228162791/posts/QpiEk7uf6Ah

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

(In reply to comment #5)
>
> I couldn't find appropriate EWMH atom to show/hide titles of maximized
> windows. My solution isn't unconditional, it adds new checkbox (initially
> unchecked) to WM tweaks.

True, indeed, I got confused.

But gtk+ has a mechanism for that: "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"

https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkwindow-x11.c#n3472

Would be great to have that as well, so that apps that use this get undecorated when maximized even if the user has not specified the option (so we geta consistent behavior with gtk+ apps at least)

Revision history for this message
In , thesame (thesame-ml) wrote :

Created attachment 5092
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED support

Diff against current git master. Must be applied on top of previous patch.

Revision history for this message
In , thesame (thesame-ml) wrote :

Nobody seems to care :(

Revision history for this message
In , Christian Hesse (eworm) wrote :

I do care and I really like it! ;)
This should be merged upstream I think.

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Hello, I've worked on this patch made by Viktor Semykin and I've made some improvements and fixes for xfwm4 4.10 and 4.11.
If you are interested it's available here: https://github.com/cedl38/xfwm4-titleless.

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Created attachment 5245
add xfwm4 titleless option for maximized windows - 4.10.1

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Comment on attachment 5245
add xfwm4 titleless option for maximized windows - 4.10.1

patch for xfwm4 version 4.10.1

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Created attachment 5246
hide title and top border on maximized features - 4.10.1

Patch for xfwm4 version 4.10.1
Add titleless maximization feature and extra functionalities:
- Change top border creation for hiding capabilities (add frameTopBorder and frameTitle functions)
- Split title-*.xpm into title and top border part if top-3-active.xpm don't exist
- add optional top_border_height and top_border_maximize parameters.

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Created attachment 5247
hide title and top border on maximized features - 4.11.0

Patch for xfwm4 version 4.11.0
Add titleless maximization feature and extra functionalities.

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Hello,

I’ve managed to implement this feature without breaking old themes.

look at #9905

Revision history for this message
In , Christian Hesse (eworm) wrote :

Created attachment 5292
Screenshot of misrendered decorations

Using the latest patch by Cédric Leporcq now. Works great on most system, though it interferes with bug 10049 [0]. Uploading a screenshot of misrendered decorations, please compare with the upload from the other bug. Any ideas what could have caused this?

https://bugzilla.xfce.org/show_bug.cgi?id=10049

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Hello Christian,

Can you please tell me witch theme are you using ? I’m wondering if this bug can be related to a specific theme.

My latest patch have made some changes regarding the theme implementation to allow top border hiding. Theses changes d’ont affect theme rendering for most of them. I noticed some glitch on few themes (like metabox) for very particular reason that can be easily fixed with theme updates.

(my latest revisions can be found here : https://github.com/cedl38/xfwm4-titleless)

Revision history for this message
In , Christian Hesse (eworm) wrote :

Hello Cédric,

this is a customized version of Curve, but plain Curve from xfwm4-themes suffers the same issue. Looks like this happens whenever just one visible pixel in a row...

I do see this in a virtualbox with guest additions installed. Bare metal with intel hardware in uneffected, so not sure if the is a xfwm4 or driver problem.

What did you change for Metabox? Perhaps that gives me any idea how to fix it.

Revision history for this message
In , Christian Hesse (eworm) wrote :

Probably worst one is Cruxish... It misses the title entirly. title-3-(in)?active.xpm is just one pixel wide, so it fits my theory.

Revision history for this message
In , Cedric Leporcq (cedl38) wrote :

Created attachment 5296
metabox bug

I can’t reproduce yours bugs on my system. To test your theory you can change the pixmaps wide from 1 pixel to 3 for example with a text editor. This change does not affect the theme appearance.

For metabox there is a bug in the theme, but only visible with my patch.
To fix it change number 2 by 3 in title_5_active_xpm with a text editor:

"8 21 2 1",
" c None",
". c #000000",
"+ c #5B80AD s active_color_1",

"8 21 2 1", should be "8 21 3 1", because there are three colors in this pixmap

Revision history for this message
In , Christian Hesse (eworm) wrote :

I think my xpm images are ok.

Looks like this only happens when X.org VESA driver is in action (which is also true for virtualbox guests whith vboxvideo). So possibly we do not have a xfwm4 bug but a X.org driver one.

Revision history for this message
In , Landry-o (landry-o) wrote :

See #9905 for work on this and patches, resolving this one as duplicate

*** This bug has been marked as a duplicate of bug 9905 ***

Revision history for this message
In , Landry-o (landry-o) wrote :

*** Bug 7436 has been marked as a duplicate of this bug. ***

Changed in xfwm4:
importance: Unknown → Low
status: Unknown → Invalid
Changed in xfwm4:
importance: Low → Unknown
status: Invalid → Unknown
Changed in xfwm4:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

Implemented with commit 2c77f62

Changed in xfwm4:
status: Confirmed → Fix Released
Revision history for this message
Sean Davis (bluesabre) wrote :

This bug was fixed in the package xfwm4 - 4.11.3-0ubuntu1 (but not included in the debian changelog)

---------------
xfwm4 (4.11.3-0ubuntu1) vivid; urgency=medium

  * New upstream release.
    - Fix maximizing vetically or horizontally tiled windows. LP: #1397922
    - Revert "Experiment with button events." LP: #1394439
    - Use source indication in activate window. LP: #1292122
    - Determine the maximum host name length correctly. LP: #1233107
  * Drop 0001-fix-fullscreen-qt4-behavior-bug-8563.patch,
    02-remove-unused-maximize-button.patch, fixed upstream
 -- Jackson Doak <email address hidden> Sun, 15 Feb 2015 06:24:16 +1100

Changed in xfwm4 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.