gtk3+ No window-borders... how to bring them back?

Problems with decorations or key/mouse bindings? Or perhaps you have a cool mouse/key binding you want to share.
scientific
Pussycat
Pussycat
Posts: 120
Joined: Thu May 15, 2008 2:26 pm

gtk3+ No window-borders... how to bring them back?

Postby scientific » Thu Oct 23, 2014 9:20 pm

Hi there!

Gtk3+ removes the Window-Borders. I think, i read something about wayland and gtk3 and so on...

So, what is the right style-Command in FVWM to draw borders and a titel to these windows again? I need them...

scientific
Debian squeeze, 2.6.32-5-amd64
fvwm 2.6.1 compiled on Apr 26 2011 at 15:45:54
with support for: ReadLine, XPM, PNG, Shape, XShm, SM, Xinerama, XRender, XCursor, XFT, NLS

User avatar
TF
Moderator
Moderator
Posts: 246
Joined: Sat Sep 10, 2005 12:30 am
Location: Germany
Contact:

Re: gtk3+ No window-borders... how to bring them back?

Postby TF » Thu Oct 23, 2014 11:08 pm

scientific wrote:Hi there!

Gtk3+ removes the Window-Borders. I think, i read something about wayland and gtk3 and so on...

So, what is the right style-Command in FVWM to draw borders and a titel to these windows again? I need them...

scientific
Generally it isn't possibel to activate a title or borders for Gtk3 applications via the style command because the Gtk3 developers hasn't provided an option to activate a title or borders.

But it exists a hack from the pcmanfm developer: https://github.com/PCMan/gtk3-nocsd.

If you have a Debian or an Ubuntu you can also use a PPA from here: http://ubuntuhandbook.org/index.php/201 ... gtk3-apps/


It works fine for me from within the terminal as described on Github :!:

In the menu you should set it like so:

Code: Select all

Exec exec env LD_PRELOAD=<"full path" of your gtk3-nocsd.so file> gedit
Works, too :P

Or you change it in the .desktop files described in the PPA link 8)


-- Thomas --
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe." -- Albert Einstein
Fvwm version: 2.6.5
Fvwm config: Fvwm-Nightshade

Tronar
Cat in the hat
Cat in the hat
Posts: 30
Joined: Thu Jun 05, 2014 5:58 pm
Location: Moscow

Re: gtk3+ No window-borders... how to bring them back?

Postby Tronar » Fri Oct 24, 2014 12:27 pm

I'd just like to understand this: Why is it a question of the library (GTK3) to provide titlebar and borders?
I thought, the window manager draws these around every window, except the application requests something different via EWMH or so. Thus I don't understand the comment "hasn't provided an option to activate [it]".

Curiously
Werner

User avatar
TF
Moderator
Moderator
Posts: 246
Joined: Sat Sep 10, 2005 12:30 am
Location: Germany
Contact:

Re: gtk3+ No window-borders... how to bring them back?

Postby TF » Fri Oct 24, 2014 3:40 pm

Tronar wrote:I'd just like to understand this: Why is it a question of the library (GTK3) to provide titlebar and borders?
I thought, the window manager draws these around every window, except the application requests something different via EWMH or so. Thus I don't understand the comment "hasn't provided an option to activate [it]".
Since Gtk3.10/11 the titlebar and borders has to be drawn by the client itself - named client side decoration. If an application hasn't explicitly implemented it, no WM can draw them.

Two good description about that problem:
- A post on the audacious forums.
- A KDE bug report.

As I understand it right, the lib created by the pcmanfm developer do exactly this - deactivating the client side decoration and fakes a title bar. Looking in the source code of gtk3-nocsd.c:

Code: Select all

// When set to true, this override gdk_screen_is_composited() and let it
// return FALSE temporarily. Then, client-side decoration (CSD) cannot be initialized.
volatile static int disable_composite = 0;
  :
  :
// This API exists since gtk+ 3.10
extern void gtk_window_set_titlebar (GtkWindow *window, GtkWidget *titlebar) {
    static gtk_window_set_titlebar_t orig_func = NULL;
    if(!orig_func)
        orig_func = (gtk_window_set_titlebar_t)dlsym(RTLD_NEXT, "gtk_window_set_titlebar");
    // printf("gtk_window_set_titlebar\n");
  :
  :
static GObject *fake_gtk_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params) {
    // printf("fake_gtk_dialog_constructor!! %d\n", disable_composite);
  :

This is summarized in the README of gtk3-nocsd as you red it:
gtk3-nocsd is a small module used to disable the client side decoration of gtk+ 3.

Introduction:
Since gtk+ 3.10, its developers added a so-called header bar or custom title bar.
With this and the client-side decoration, the original title bar and window border
provided by the window manager are disabled by gtk+. This makes all gtk+ 3 programs
look like align. Even worse, this may break some window manager or compositors.

Unfortunately, the gtk+ developers decided to be against the
existing standards and provide "no option" to turn it off.

Luckily, with gtk3-nocsd, we still have a way to (partially) turn it off.

I hope it's now better understandable why FVWM cannot draw a title/borders and the style command won't work.

-- Thomas --
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe." -- Albert Einstein
Fvwm version: 2.6.5
Fvwm config: Fvwm-Nightshade

Tronar
Cat in the hat
Cat in the hat
Posts: 30
Joined: Thu Jun 05, 2014 5:58 pm
Location: Moscow

Re: gtk3+ No window-borders... how to bring them back?

Postby Tronar » Sat Oct 25, 2014 8:31 pm

Okay, I understand, although my knowledge of X & WM is limited. I've always thought that a WM, like every other X client, can draw whatever it wants. I didn't know that X implements a mechanism at all so that this can be forbidden by an application like GTK3.

Thanks for the information
Werner

scientific
Pussycat
Pussycat
Posts: 120
Joined: Thu May 15, 2008 2:26 pm

Re: gtk3+ No window-borders... how to bring them back?

Postby scientific » Tue Oct 28, 2014 10:46 am

Thx for this info.

Is it right, that csd is used by wayland? And applucations get ready piece for piece for wayland?

Scientific
Debian squeeze, 2.6.32-5-amd64
fvwm 2.6.1 compiled on Apr 26 2011 at 15:45:54
with support for: ReadLine, XPM, PNG, Shape, XShm, SM, Xinerama, XRender, XCursor, XFT, NLS

scientific
Pussycat
Pussycat
Posts: 120
Joined: Thu May 15, 2008 2:26 pm

Re: gtk3+ No window-borders... how to bring them back?

Postby scientific » Tue Oct 28, 2014 10:56 am

Debian squeeze, 2.6.32-5-amd64
fvwm 2.6.1 compiled on Apr 26 2011 at 15:45:54
with support for: ReadLine, XPM, PNG, Shape, XShm, SM, Xinerama, XRender, XCursor, XFT, NLS

User avatar
ILLUXA
Kitten
Kitten
Posts: 23
Joined: Sat May 28, 2016 4:07 pm
Location: $[HOME]

Re: gtk3+ No window-borders... how to bring them back?

Postby ILLUXA » Tue Jul 19, 2016 6:32 am

May be someone doesn't know, it is posible to hide all window buttons on GTK3 apps,
just edit ~/.config/gtk-3.0/settings.ini

Code: Select all

gtk-decoration-layout=:minimize,maximize,close

change it to

Code: Select all

gtk-decoration-layout=:menu

Also I'm using

Code: Select all

Style Nautilus NoDecorHint
Style Totem NoDecorHint, TitleFormat %c
Style File-roller NoDecorHint, TitleFormat %c

in ~/.fvwm2rc. Then these apps are pretty usable imo.
For example Nautilus file manager looks pretty nice,
just enable org > gnome > nautilus > preferences always-use-location-entry via dconf-editor.
screenshot (nautilus, totem and file-roller archive manager on FVWM) http://i.imgur.com/UqfVXwz.png

To disable GTK3 black window borders, add

Code: Select all

.window-frame {
  box-shadow: none;
  margin: 0;
}

to ~/.config/gtk-3.0/gtk.css.
Last edited by ILLUXA on Thu Jul 21, 2016 12:26 pm, edited 1 time in total.
Transcend or Die

FVWM 2.6.7, FreeBSD 11.1-RELEASE

somiaj
Administrator
Administrator
Posts: 46
Joined: Mon Nov 08, 2004 9:54 pm
Location: Idaho (USA)
Contact:

Re: gtk3+ No window-borders... how to bring them back?

Postby somiaj » Thu Jul 21, 2016 7:18 am

I am able to get decorations around evince by using the line

Code: Select all

Style "Evince" !MWMDecor


in my config file.

You may also want to look at the MWMFunctions and !MWMFunctions styles as well
-jaimos


Return to “Decorations and bindings”

Who is online

Users browsing this forum: No registered users and 1 guest