bbidulock / blackboxwm

A window manager for X11
Other
169 stars 30 forks source link

Setting a non-maximized window to fullscreen causes the title bar to remain #18

Closed vl-80 closed 6 years ago

vl-80 commented 6 years ago

I run into this while using Firefox. Setting Firefox to fullscreen (pressing F11) when it is not maximized causes the window title bar to remain.

It does not happen when Firefox window is first maximized and then set to fullscreen.

When a maximized window is going full screen following functions are called (in Window.cc)

SetFullScreen()
   |
   |-->configure()
         |
         |-->redrawWindowFrame()

The redrawWindowFrame() in this case does not render title bar because if (client.decorations & WindowDecorationTitlebar) condition is not met.

However, for a non maximized window, following functions are also called multiple times while window is being expanded:

propertyNotifyEvent()
   |
   |-->update_decorations()
   |-->reconfigure()
         |
         |-->configure()
               |
               |-->redrawWindowFrame()

If I understand correctly, update_decorations() enables decorations for the window. And when redrawWindowFrame() is called, the if (client.decorations & WindowDecorationTitlebar) evaluates to TRUE and the title bar is being rendered.

I assume it can be fixed by adding following code to the update_decorations() function

if (ewmh.fullscreen) {
   decorations = NoWindowDecorations;
   functions &= ~(WindowFunctionMove |
                  WindowFunctionResize |
                  WindowFunctionShade);
}

Link to patch

bbidulock commented 6 years ago

Thanks for tracking this down! Please send a pull request.