You are not logged in.

#1 2015-01-18 23:54:34

Everdras
Member
Registered: 2012-09-13
Posts: 35

[solved] Undecorate a single window in Gnome Shell

Is there a convenient way to toggle the WM decorations (specifically the title bar) off and on in Gnome for one specific window?

I'm trying to play an old game in wine that only has static resolution options and it crashes if you try to edit the options in the save files. unfortunately the 2nd-largest option is pretty small on my 1080p 14" laptop monitor and the largest option puts me about 20px off the bottom of the screen. I could regain these 20+ pixels if I could toggle the title bar off once I get the game going.

Does anyone know how I could do this? Googling for this is a little difficult since the results are polluted by people who are trying to undecorate maximized windows (by editing the GTK theme and I don't want such an invasive/wide-bore solution).

Last edited by Everdras (2015-01-19 02:44:18)

Offline

#2 2015-01-19 00:05:02

progandy
Member
Registered: 2012-05-17
Posts: 5,199

Re: [solved] Undecorate a single window in Gnome Shell

You might want to try and toggle the fullscreen state

xprop -f _NET_WM_STATE 32a -set _NET_WM_STATE _NET_WM_STATE_FULLSCREEN
# or
wmctrl -r :ACTIVE: -b toggle,fullscreen

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2015-01-19 02:44:00

Everdras
Member
Registered: 2012-09-13
Posts: 35

Re: [solved] Undecorate a single window in Gnome Shell

progandy wrote:

You might want to try and toggle the fullscreen state

xprop -f _NET_WM_STATE 32a -set _NET_WM_STATE _NET_WM_STATE_FULLSCREEN
# or
wmctrl -r :ACTIVE: -b toggle,fullscreen

This looks like an acceptable workaround. Thanks!

Offline

#4 2015-01-19 03:33:44

Everdras
Member
Registered: 2012-09-13
Posts: 35

Re: [solved] Undecorate a single window in Gnome Shell

Thanks to your tip and some google, I've improved my answer.

The game I'm playing is being run in a wine virtual desktop, so the window title is "Default - Wine desktop"

I found this blog: http://mathematicalcoffee.blogspot.com/ … mised.html which details how to set the WM hints on windows with xprop. I hacked together my own solution in the form of this script:

if [[ $1 == "undec" ]] ;
then
  xprop -name "Default - Wine desktop" -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0"
else
  xprop -name "Default - Wine desktop" -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x1, 0x0, 0x0"
fi

Running it with "undec" undecorates the window, running it with anything else redecorates it.

Caveat: if you redecorate the window, sometimes the window stops responding to keyboard input. Mouse still works. This isn't an issue for me since I won't be redecorating the game until I'm done playing, and I can still alt-tab and stuff. Restarting gnome (with alt+f2 and running 'r') might fix it as well, but I didn't check yet.

Last edited by Everdras (2015-01-19 03:34:07)

Offline

Board footer

Powered by FluxBB