Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run X11 windows without windows manager decoration #530

Open
davidhunter22 opened this issue Oct 21, 2021 · 44 comments
Open

Run X11 windows without windows manager decoration #530

davidhunter22 opened this issue Oct 21, 2021 · 44 comments
Labels
enhancement New feature or request

Comments

@davidhunter22
Copy link

Is it possible to run an X11 windows without the window manager decoration, I believe this is sometimes called frameless or borderless.

@davidhunter22 davidhunter22 added the enhancement New feature or request label Oct 21, 2021
@Biswa96
Copy link
Contributor

Biswa96 commented Oct 21, 2021

What do you mean by "window manager decoration"? Any screenshot would be helpful.

@davidhunter22
Copy link
Author

davidhunter22 commented Oct 21, 2021

I mean the buttons like the "x" that are common on most windows. On a native Linux box you can run windows without this decoration which is added by the window manager not the application. Attached is a screen shot of xeyes which has the decoration.

Screenshot 2021-10-21 103335
e

@hideyukn88
Copy link
Member

@davidhunter22, thanks for trying out WSLg. Unfortunately that's not possible for now, unless application supports "fullscreen" (such as Firefox) then application takes entire screen and no window decoration. May I ask why this helps? Thanks!

@davidhunter22
Copy link
Author

It was more out of interest, I was just seeing what features were supported versus a native X11 Windows manager.
The architecture diagram does show an X Window Manager running.
On a related topic can you, or will you be able to, choose what X Window Manager you are running?

@davidhunter22
Copy link
Author

Ah just found this, #67 which seems to answer my question on window managers

@AntonSmolkov
Copy link

AntonSmolkov commented Nov 14, 2021

This is “fullscreen” Rider IDE under WSLG. This box around also makes me feel sad☹️

94C4C7A8-EC1C-4AD7-8E13-4C7255B77226

@sweetwong
Copy link

image

Please add fullscreen feature
I don't want to see this white box

@GiGurra
Copy link

GiGurra commented Feb 12, 2022

Single biggest show stopper for me before switching from VcXsrv -> wslg.
Second biggest show stopper is wslg windows not seemingly supporting windows tiling/snapping/windows+LR hotkeys

@hideyukn88
Copy link
Member

@GiGurra, thanks for feedback, we are aware that the "second one" is asked various occasions.

Regarding to no window decorations, @AntonSmolkov @sweetwong and @GiGurra, do you want only when window is at fullscreen? and without those frame, how do you expect you can put back window to non-fullscreen? Or even no frame at windowed (non-fullscreen), how it's expected to be moved? Do know have any model scenario we can refer to? thanks!

@GiGurra
Copy link

GiGurra commented Feb 14, 2022

@hideyukn88 Thanks for the answer.

No definitely not only full screen. In fact full screen is something I am less interested in.
I am mostly working in split screen mode with 2/3 of the screen being my IDE and 1/3 as a terminal.

The best example is the IDE intellij idea. You can download the free community version to see what it currently looks like inside wslg, and compare with how it behaves with a native windows installation.

Basically it always runs without decoration (it renders its own menus and minimize/maximize buttons etc in its own format)

Native windows/native linux/native mac:

image

wslg:

image

ideal result:

image

@hideyukn88
Copy link
Member

@GiGurra, thanks for info.

By looking at native Linux case, particularly running on Ubuntu desktop, the window frame (and title bar) seems still rendered by their Window manager, but it has more consistent visuals with rest of the desktop. So, to clarify the request here would be, it is not removing the window decorations, but do have window decorations with match to the rest of desktop and themes.

Regarding to fullscreen case, it looks on JetBrains IDE, "enter fullscreen mode" option (from View->Appearance) is not available on WSLg, but it is available on Ubuntu desktop. I will need to investigate why.

Also, once JetBrains completed the Wayland native support, then the current Window frame won't be used.

Thanks!

@GiGurra
Copy link

GiGurra commented Feb 15, 2022

@hideyukn88

Ah, yes you are right. I had completely forgotten that ubuntu does keep some decoration at the top (but not these thick lines all around). When I last used native ubuntu for my dev machine I was actually running some decoration removal thing, dont remember exactly what :)

For reference, here is what wsl + VcXsrv (wsl rendering through x server implementation running on windows) looks like right now:

image

@differentprogramming
Copy link

Can we at least change the color to make it less obtrusive on a dark themed screen?

@JotaRata
Copy link

TBH that would be a really cool feature

@zodiia
Copy link

zodiia commented Dec 19, 2022

Any update on this? WSL has gone out of preview and yet this issue is still present.

Most of third party softwares that emulates X Servers managed to use native windows. Yet WSLg still has this ugly window manager decoration (let's be honest for a second, it looks like it wasn't updated for at least 15 years), and it doesn't even support basic window snapping, even less the more advanced features that we have with a native window.

This is a huge deal breaker for WSLg. I was excited for the GUI apps support on Windows 10, but this alone makes me switch back to X410.

@hideyukn88 @Biswa96

@theonlyfoxy
Copy link

+1 for This Issue. VcXsrv is still better in Window Management than WSLg.

@hideyukn88
Copy link
Member

@theonlyfoxy, thanks for checking, we are making progress. if you are on the latest WSLg and Windows 11 (all update applied), please create below file with below contents, then window can be snapped by Win+Left or Right key, thanks!

C:\Users\[Your User Name]\.wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=true
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true

@theonlyfoxy
Copy link

@theonlyfoxy, thanks for checking, we are making progress. if you are on the latest WSLg and Windows 11 (all update applied), please create below file with below contents, then window can be snapped by Win+Left or Right key, thanks!

C:\Users\[Your User Name]\.wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=true
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true

What about the borders around the window and style of buttons?
Wouldn't it be possible to integrate vcxsrv into WSLg and fallback X11 apps to it?

@cyraid
Copy link

cyraid commented Mar 17, 2023

Without borders, the window is offset from the top left. I've noticed this in my own development as well. Having a maximized borderless window results in:

image

Everything you click on will be offset as well.
Meanwhile having borders on, maximize will be correct:

image

Just wanted to add, you guys are doing an awesome job! This helps my graphical linux development too!! Thank you for all the hard work you're doing! @hideyukn88 and everyone!

@zodiia
Copy link

zodiia commented Mar 24, 2023

@cyraid how did you manage to remove the window borders? I think it's the whole point of this issue and it seems you've found some kind of magic to achieve it 😅

@cyraid
Copy link

cyraid commented Mar 24, 2023

@zodiia Oh, that's just a borderless window. You have to specify the XInternAtom(d, "_MOTIF_WM_HINTS", False); for xlib when creating the window (or glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); for GLFW, etc.)

For programs that you haven't written, there's not much you can do other than ask Microsoft to include Decoration options with WSLG (or at least environment variables to disable decorations on windows) as they're the current window manager, unless you can use a custom window manager with WSLG which I'm not sure you can currently? (based off of what I've been reading)

But for those screenshots: With Chrome in Linux, you can set the window to use no titlebar (so I'm guessing they're just setting the decorator hints to false). Btw, to fix that Chrome issue, you can set the Preferred Ozone platform in chrome://flags to Wayland for a better experience.

@gaoyan1998
Copy link

Hi, is there a solution to this problem, now idea still has a big box wrapped around it

@zodiia
Copy link

zodiia commented Aug 29, 2023

Hi, is there a solution to this problem, now idea still has a big box wrapped around it

No solution yet, however we might be getting closer to it with Jetbrains products specifically, as they have recently released features for integrating the top bar with the window, just like it is on windows. We might get something better for IntelliJ, CLion, ... soon

@andrescevp
Copy link

It will be nice if we could simply set the colors of the borders, I mean, there are some constraints totally understable regarding usability and compatibility, but, I believe the simples solution is the best one.

@sweetwong
Copy link

Is there any progress here?

@sweetwong
Copy link

@zodiia I think window border color following Windows system theme(Light or Dark) is a simple solution.

@bitnom
Copy link

bitnom commented Jan 13, 2024

lol my linux broke and I wound up having to use WSL and now PyCharm ugly af. What are we doin here guys? Where's the code for these titlebars? We'll fix it ourselves.

@sweetwong
Copy link

Why hasn't a seemingly straightforward request been accommodated after several years? Alternatively, could you provide guidance on how we might resolve this issue ourselves?

@deadcombo
Copy link

deadcombo commented Mar 7, 2024

I've found this can be overridden in Emacs with the undecorated frame parameter.

See https://www.gnu.org/software/emacs/manual/html_node/elisp/Management-Parameters.html#undecorated.
It mentions Motif Window Manager Hints: https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html so maybe it can be generalized @hideyukn88

Didn't manage to make it work in early-init.el but it does in init.el. Just (push '(undecorated .t) default-frame-alist).

If you can't make it work for some reason, toggle-frame-fullscreen is viable as you can still snap (Win + arrows) the fullscreen frame.

@Stanzilla
Copy link

@theonlyfoxy, thanks for checking, we are making progress. if you are on the latest WSLg and Windows 11 (all update applied), please create below file with below contents, then window can be snapped by Win+Left or Right key, thanks!

C:\Users[Your User Name].wslgconfig

[system-distro-env]
WSLG_USE_MSTSC=true
WESTON_RDP_WINDOW_SNAP_ARRANGE=true
WESTON_RDPRAIL_SHELL_LOCAL_MOVE=true

Any updates on this? Is this still needed? What about disabling the white window chrome?

@undrivendev
Copy link

Any news?

@meminuygur
Copy link

any news?

@old-df38257622
Copy link

old-df38257622 commented Sep 2, 2024

+1 this is still a very annoying issue nearly 3+ years later

@sameert89
Copy link

+1 this is the only thing stopping me from liking my setup.

@moisei
Copy link

moisei commented Sep 22, 2024

@davidhunter22 , @sameert89 Enjoy!

sudo apt install -y xdotool
xeyes&
xprop -id $(xdotool search --name xeyes) -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "2, 0, 0, 0, 0"

@cyraid
Copy link

cyraid commented Sep 23, 2024

I think the whole 'remote desktop' approach isn't entirely too smooth IMO. You're not seeing a native solution, you're seeing a Remote Desktop Protocol in action, think using Remote Desktop into someone's machine.

It 'kinda' works, 'cause you can do things like gaming in the cloud with such techniques, but you'll always have that latency and I don't think video approach is the best. Realistically the best approach would be a native Linux Display Driver. But of course Microsoft may be worried about Kernel boundaries, and running things in Kernel land. I wonder if Microsoft is planning such, and the current RDP is a placeholder? Would like to know thoughts of Microsoft developers on this one.

@onomatopellan
Copy link
Contributor

@cyraid I recommend you to watch this video https://www.youtube.com/watch?v=EkNBsBx501Q and read https://devblogs.microsoft.com/commandline/wslg-architecture/
The future of WSLg is version 2.x, the VAIL+vGPU implementation that uses vRAM instead of system RAM and will bring zero copy, minimal latency.

@sweetwong
Copy link

I've perfectly solved this problem!!

Bash Script:

#!/bin/bash

# Check if any arguments were passed
if [ $# -eq 0 ]; then
  echo "Usage: $0 <window_name>"
  exit 1
fi

# Use the passed argument as the window name
window_name="$1"

# Find all windows matching the window name
window_ids=$(xdotool search --name "$window_name")

# Check if any windows were found
if [ -z "$window_ids" ]; then
  echo "No windows found with the name '$window_name'"
  exit 1
fi

# Loop through all found window IDs and perform the operations
for window_id in $window_ids; do
  echo "Processing window ID: $window_id"
  # Remove window borders
  xprop -id $window_id -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "2, 0, 0, 0, 0"
  # Set window to fullscreen
  wmctrl -ir $window_id -b add,fullscreen
done

echo "All windows have been processed"

Use:

# bash script name: fullscreen, for example: fullscreen xeyes
fullscreen YOUR_WINDOW_NAME

image

@meminuygur
Copy link

sweetwong

I tried it on phpstorm bot did not work.

@sameert89
Copy link

@davidhunter22 , @sameert89 Enjoy!

sudo apt install -y xdotool
xeyes&
xprop -id $(xdotool search --name xeyes) -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "2, 0, 0, 0, 0"

Legend! How do you even figure this out? Thanks a bunch!

@moisei
Copy link

moisei commented Sep 26, 2024

@sameert89 chatgpt

@sweetwong
Copy link

sweetwong

I tried it on phpstorm bot did not work.

@meminuygur When running this command, ensure that PhpStorm does not launch in a maximized state.

@antonio24073
Copy link

Hi,
I'm using windowgrid and I need the click sensibility in the title bar.
Please how could I temporally return to old window decoration?
Best regards.

@MichelTenVoorde
Copy link

Awesome @moisei! Now we just need a way to make IntelliJ (& friends) render its own buttons again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests