Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-04-13 14:02:04

etatoby
Member
Registered: 2017-04-13
Posts: 2

Window decoration border when maximized

Hello

I'm trying to replicate a window decoration style I have been using on various window managers since KDE 2, one that is based on the MWM / CDE style.

This is what it should look like for regular windows:

mwm1.png

And for a maximized window (ignoring the size):

mwm2.png

By the way, the orange is only used to highlight the active window, otherwise it would be grey/blue. I will post full screenshots and the theme files when it's ready.

Leaving aside the toggled maximize button (I can live without it, if it's not an option) I'm having a hard time with the window borders. If I use the option to remove the borders on maximized windows, only the side borders are removed, but the top "border" remains, because it's really part of the title in an XFCE theme:

mwm3.png

Can I remove the top border too, maybe using some kind of negative margin? I tried various combinations of options, to no avail. Is this effect at all possible in XFCE?

Last edited by etatoby (2017-04-15 15:40:53)

Offline

#2 2017-04-14 21:55:07

MountainDewManiac
Member
From: USA police-state welfare-state
Registered: 2013-03-24
Posts: 798

Re: Window decoration border when maximized

There appears to be an issue with the image links you posted.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#3 2017-04-15 15:41:14

etatoby
Member
Registered: 2017-04-13
Posts: 2

Re: Window decoration border when maximized

Thank you.
Stupid image host!

Offline

#4 2017-04-15 18:40:19

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,591

Re: Window decoration border when maximized

I don't think it's possible. As you've noted, the top border is part of the images that make up the title bar part of the xfwm4 theme, so they can't be removed. I can't think of a way to add negative margins either.

Thinking out of the box, if you created a second theme that was exactly the same as the first except for the top border, you could run a repeating script that looks for a window that is maximized and focused, and change the themes on the fly. Something like:

#!/bin/bash

LAST_STATE=0

while true
do
   let FOUND=0
   for wid in $(wmctrl -l | awk '{print $1}')
   do 
      if xprop -id $wid | grep _NET_WM_STATE | grep -E "MAXIMIZED_HORZ.*MAXIMIZED_VERT.*STATE_FOCUSED" > /dev/null; then 
         let FOUND=1
         break
      fi  
   done
   
   if [ $FOUND -eq 1 ]; then
      if [ $LAST_STATE -ne 1 ]; then
         let LAST_STATE=1
         xfconf-query -c xfwm4 -p /general/theme -s "theme_no_top_border"
      fi
   else
      if [ $LAST_STATE -eq 1 ]; then
         let LAST_STATE=0
         xfconf-query -c xfwm4 -p /general/theme -s "theme_with_top_border"
      fi
   fi
       
sleep 1
done

Replace the strings "theme_no_top_border" and "theme_with_top_border" with the appropriate window manager theme names.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#5 2017-04-15 19:22:21

Spass
Member
From: Poland
Registered: 2016-12-07
Posts: 5
Website

Re: Window decoration border when maximized

ToZ, just out of curiosity - could this script be modified to set different Xfwm theme for a different applications on the fly? Based on xprop WM_CLASS for example.

Offline

#6 2017-04-16 00:01:24

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,591

Re: Window decoration border when maximized

Spass wrote:

ToZ, just out of curiosity - could this script be modified to set different Xfwm theme for a different applications on the fly? Based on xprop WM_CLASS for example.

Modified in what way? Do you want it to do exactly the same but have different window manager themes depending on which application is maximized and focused?

Or are you thinking about something a little different? If so, how do you expect that it would work?

Please note that using this method isn't without it's draw backs. The change wouldn't be instantaneous (it might be as slow as one second late due to the sleep timeout) and you would have a script constantly running and checking on the state of all open windows.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#7 2017-04-16 01:28:11

Spass
Member
From: Poland
Registered: 2016-12-07
Posts: 5
Website

Re: Window decoration border when maximized

Just different Xfwm theme on different application(s). Let's say I want xfce4-terminal to have red borders ("B theme") and the rest would use default theme selected in xfwm4-settings ("A theme") as normal. No matter the current state of that xfce4-terminal window (maximized, inactive etc.).

Not that I need it personally, but I was searching lately if it's possible in Xfce (for fun) and I found some forum threads saying it's not (there was just a solution for different GTK2 theme). Plus, someone just recently asked me this in the comments on xfce-look.org under my Xfwm theme.

Offline

#8 2017-04-16 14:30:46

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 3,591

Re: Window decoration border when maximized

Spass wrote:

Just different Xfwm theme on different application(s). Let's say I want xfce4-terminal to have red borders ("B theme") and the rest would use default theme selected in xfwm4-settings ("A theme") as normal. No matter the current state of that xfce4-terminal window (maximized, inactive etc.).

Not really. Any method you use would change the window manager theme for all applications displayed, not just for xfce4-terminal.


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

Board footer

Powered by FluxBB