You are not logged in.

#1 2022-09-30 03:48:32

arska3
Member
Registered: 2022-03-18
Posts: 12

[SOLVED] Openbox Firefox CSD big white border around browser window

Hello,

I'm trying to use Firefox on my Openbox setup which has no window borders at all (0px), while also using the Client-Side Decoration (CSD) titlebar where the tab bar and the window controls are merged on Firefox.

However when I turn on the CSD titlebar, Firefox will draw a white border around the window, pictured here:
https://imgur.com/a/b5QAvJ5

I notice that the appearance and size of the border is related to whichever GTK 3 theme I'm using, which in that pic is Adwaita. From what I tried, Arc-Darker GTK theme has the most agreeable looking border, which is a tiny, dark border.

However, if possible, I would like to completely remove the window border. Is there any way to achieve this?

I understand that this means I can no longer resize window by clicking on the border with mouse. This is how my Openbox theme functions, anyways, and I use keyboard, or a Meta+Click to resize from anywhere on the window.

Without CSD titlebar it looks how I want, other than the extra Openbox titlebar which I don't want:
https://imgur.com/a/YjWtgPw

Any tips welcome, even if hacky workarounds!

Last edited by arska3 (2022-10-01 04:54:51)

Offline

#2 2022-09-30 06:58:29

seth
Member
Registered: 2012-09-03
Posts: 53,879

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

You'll have to overwrite the style, judging from https://gitlab.gnome.org/GNOME/gtk/blob … ommon.scss it's probably the ".solid-csd &" padding that causes this.
~/.config/gtk-3.0/gtk.css might take precedence, otherwise you'll have to re-compile the style

Without CSD titlebar it looks how I want, other than the extra Openbox titlebar which I don't want:

my Openbox setup which has no window borders at all (0px)

???
Just disable both?

Online

#3 2022-09-30 08:15:13

arska3
Member
Registered: 2022-03-18
Posts: 12

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

Thanks a lot for that tip, I'll look into it later today.

seth wrote:

???
Just disable both?

Oh yea, I see how this is confusing - I can just turn off window decorations for Firefox, which otherwise is perfect but now I don't have the 3 window control buttons in the top right corner. I like those buttons as well as the consistency of each window having those (even if a bit different style).

Offline

#4 2022-09-30 11:10:17

seth
Member
Registered: 2012-09-03
Posts: 53,879

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

So you're generally using CSD and only in FF/mozilla it gets you the weird outline?
Do you use a compositor (eg. picom)?

Online

#5 2022-09-30 12:44:16

arska3
Member
Registered: 2022-03-18
Posts: 12

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

Yes that's right, I haven't had a similar issue with any other application so far.

Yea I use picom, I was meaning to investigate that as well due to an issue with the context menus having a weird transparent frame when picom is running, screenshots here:
https://imgur.com/a/gLaHNzt

However with compositor off the window border is the same, so I thought these 2 issues might not be related.

Offline

#6 2022-09-30 13:56:59

seth
Member
Registered: 2012-09-03
Posts: 53,879

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

I'd guess that ".solid-csd" doesn't apply when running a compositor and if other gtk clients aren't affected, this is probably yet another FF/mozilla specific thing.
The menu screenshot looks like the menu comes w/ its own shadow, so you'd have to exclude it from picom (anything "_GTK_FRAME_EXTENTS@:c" might do…)

Online

#7 2022-10-01 04:54:00

arska3
Member
Registered: 2022-03-18
Posts: 12

Re: [SOLVED] Openbox Firefox CSD big white border around browser window

Yes, thanks so much seth. I was able to solve both issues now.

To have a borderless Firefox with CSD decorations:
In ~/.config/gtk-3.0/gtk.css

.solid-csd decoration {
    padding: 0px;
    border: 0px;
}

Fix transparent frame around FF menubars:
In ~/.config/picom/picom.conf

shadow-exclude = [
    "_GTK_FRAME_EXTENTS@:c",
    "override_redirect = true"
];

Edit: Update on the menu shadow fix

Looks like only the line "override_redirect = true" was needed, but I also noticed that Rofi windows lose their shadow with this setting, which I prefer to have on. To re-enable the shadow for Rofi, I find the following solutions:

shadow-exclude = [
    "class_g != 'Rofi' && override_redirect = true"
];

.. or ..

shadow-exclude = [
    "class_g = 'firefox' && override_redirect = true"
];

Last edited by arska3 (2022-10-02 03:17:32)

Offline

Board footer

Powered by FluxBB