How to get rid of the title bar add to non-gtk applications in elementary OS - gtk3

In elementary OS Loki, for applications like gvim, urxvt and Xephyr, there will be a title bar added to the application window. Is there anyway to get rid of the title bar?
Vim with title bar
urxvt with title bar

The title bar is called window decoration. Window decoration depends on the window manager, as stated in the documentation:
By default, windows are decorated with a title bar, resize controls,
etc.
Some window managers allow GTK+ to disable these decorations, creating
a borderless window. If you set the decorated property to false using
this function, GTK+ will do its best to convince the window manager
not to decorate the window. Depending on the system, this function may
not have any effect when called on a window that is already visible,
so you should call it before calling show.
On Windows, this function always works, since there’s no window
manager policy involved.
Try using window.set_decorated(false);

I don't know what display manager you are using but I believe Loki ships with GNOME so try looking into some of the Gnome extensions, e.g. PixelSaver or Maximus, though the latter may need a few tweaks as it's been without maintenance for a bit.

Related

Make Vscode on Gnome look like Windows?! (Removing the gnome titlebar)

Intro
How to change VSCODE Gnome(41+) TopBar to look like the windows topbar?
To:
Currently the top bar on GNOME takes a good amount of space. Also it doesn't look good(imo). How would i be able to change this?
How to set it up
If you open the Setting tab(Ctr+,) You can search for titlebar
Chane the Window:Title Bar Style from native to custom . Boom! Reload your vscode, and you have a window-like title bar
{
"window.titleBarStyle": "custom"
}

Widget sensitive/gray look change with window focus causes too much delay

I like to adjust or disable a feature of gtk3 (or gnome-shell?) because it causes a delay or at least need to remove the delay when bringing a window in/out of focus. My multi window application suffers from this delay:
I see is that all widgets like buttons, entries, etc. are set to in-sensitive/gray look at time the window they are contained is loosing focus and they return to normal when the window focus returns. I tried to turn off animations, but that does not disable this behavior.
My old program version based on gtk2 based does not have this feature (same gnome shell). So I conclude gtk3 is some how managing this.
I so far was not able to find out how to disable this.
This is part of the default (Adwaita) desktop theme, and as such you can't disable it for one application. Each window's widgets get the :backdrop CSS pseudo-class when it is not the active window, and the Adwaita theme styles them that way.
Your best bet is to pick another desktop theme.

Set MATLAB Programming Environment fullscreen (without Title Bar) in Windows

I am currently setting up my MATLAB programming environment in windows. I am trying to remove the title bar at the very top of the screen while editing code. It is similar to the "Enter Full Screen" feature in IntellijIDEA based editors. I am well aware that this is possible MacOSX but did not find any feature supported in Windows. Thank you in advance for your help.
Matlab does not have a true full-screen option on Windows, but take a look at this help page: Optimize Desktop Layout for Limited Screen Space.
Title bars can be hidden by going to the Home tab > Environment section > Layout. Under Show, you can select or deselect "Panel Titles".
You can also hide the toolstrip by clicking the arrow in the upper right corner.
There appears to be no way to hide the Windows title bar and tabs at the very top, but combining these options should get you pretty close to the "full-screen" look you describe.

Undecorated window loses native events

I use Decorated = false to make a frameless, borderless window with gtk#. This means adding my own drag logic and events for minimizing and closing the window, fine. However in Windows (at least), the window loses its native minimize/restore/close animations and I'm unable to minimize the window by clicking in the taskbar as you usually can.
Is there a way to have an undecorated window in gtk and still get the native minimize/restore animations or at least being able to minimize it from the taskbar?
I've experienced this as well. It is my understanding (maybe incorrect) that such features are a part of the windowing for the application. With it undecorated they simply don't exist in the taskbar. You might be able to create "Tasks" that are available when you right-click on the taskbar icon, but I have no experience with doing so. I believe those are technically called "JumpLists" or something like that.

GTK window hints

I'm trying to get a window to cover the whole screen. Its positioning and dimensions is fine but it gets covered by the Gnome panel. To complicate things I have two monitors and this app needs to support people with multiple screens.
WINDOW_TYPE_HINT_SPLASHSCREEN is a good start. It covers both screens but not the panel. It's still there, just behind the panel.
WINDOW_TYPE_HINT_DOCK looked ideal but I need this window to take focus to listen to a keyboard event. _DOCK seems like it purposely ignores keyboard events (which kind of makes sense). Can I force it to take keyboard focus?
Is there some way I can force a hinted window to cover the panel?
There's window.fullscreen() which you can call on a normal "un-hinted" window. I assume this lets the window manager decide whether the window should cover the panel or not.
If you use the WINDOW_TYPE_HINT_MENU, you can give the focus to the window by calling the gtk_window_present() function.
However, I don't know if you will be able to cover the panel.
Another hint: the panel probably change its _NET_WM_STRUT property so that other windows cannot cover it. Maybe you will have to play with this property (or another) in your window.