lawl / opensnap

Aero like snap feature for openbox.
BSD 2-Clause "Simplified" License
60 stars 18 forks source link

Apps with header bar #19

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi, opensnap doesn't work with applications like Evince and others that use CSD (http://blogs.gnome.org/mclasen/2014/01/13/client-side-decorations-continued/), and also with Chromium. Would be great if it's possible to fix this...

lawl commented 10 years ago

The easiest way might be to just disable CSD. Opensnap needs to know the size of the titlebar, right now it gets this from the EWMH hint _NET_FRAME_EXTENTS.

With a regular window this looks like this: _NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 18, 0 With a CSD window it looks like this: _NET_FRAME_EXTENTS(CARDINAL) = 2, 2, 2, 2

The title bar height with a regular window would be 18px. With CSD the window draws it own title bar as part of the window and I do not see a way to retrieve the height using X/EWMH.

Chromium does have a regular title bar for me, maybe I've configured that a while back? I can't reproduce that.

As for fixing it, do you know a way to retrieve the size of the CSD using X APIs and EWMH?

If not, the only way to fix this is using hacks to disable CSD.

AlisterH commented 10 years ago

FWIW chromium has a setting under "appearance": "Use system title bar and borders"

ghost commented 10 years ago

This looks like a bug in Gtk, here I've reported it: https://bugzilla.gnome.org/show_bug.cgi?id=736822