Bug 412080 - add 2px border to CSD gtk windows when shadows are not supported from window manager
Summary: add 2px border to CSD gtk windows when shadows are not supported from window ...
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-19 20:00 UTC by Thanos Apostolou
Modified: 2019-09-21 22:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thanos Apostolou 2019-09-19 20:00:20 UTC
SUMMARY
CSD gtk apps are not resizable by mouse when the breeze gtk theme is used in window managers that don't support GTK_FRAME_EXTENDS like openbox and kwin (currently). Add 2px border to CSD windows only when shadows are not supported. I don't know exactly which css property it is but adapta and adwaita gtk themes are already doing this (CSD windows using these themes don't have borders when used with gnome or xfwm4, but they have a thick border when used with openbox/lxde). This should be fixed in the breeze gtk theme (so that it will work for all window managers) independently from https://bugs.kde.org/show_bug.cgi?id=390550

STEPS TO REPRODUCE
1. Try to resize a CSD gtk app (like gnome-disks) when using kwin or openbox

SOFTWARE/OS VERSIONS
all breeze gtk versions I've tried
Comment 1 Nate Graham 2019-09-19 20:12:17 UTC
Excellent idea.
Comment 2 Thanos Apostolou 2019-09-19 21:22:39 UTC
I experimented a bit with the css and the settings that look best to me are those:

Edit /usr/share/themes/Breeze/gtk-3.20/gtk.css and inside "decoration { ... }" 

change:

.solid-csd decoration {
  ...
  border: solid 2px #475057;
  background-color: #475057;
  ... }

also add a copy of that below:

.solid-csd decoration:backdrop {
  ...
  border: solid 2px #eff0f1;
  background-color: #eff0f1;
  ... }

Edit /usr/share/themes/Breeze-Dark/gtk-3.20/gtk.css and inside "decoration { ... }"
change:

.solid-csd decoration {
  ...
  border: solid 2px #31363b;
  background-color: #31363b;
  ... }

(the 3 dots mean the rest properties as they are)

The .solid-csd decoration property applies only to window managers which don't support shadows, so the borders are shown in kwin and openbox but not in xfce, gnome and cinnamon. I'm not familiar with kde development but I'll see if I can do a pull request or something if its hasn't been fixed until I get some free time (if someone can point me where shall I do that it would be helpfull).
Comment 3 Janet Blackquill 2019-09-19 21:23:47 UTC
Could you send a screenshot of what it looks like?
Comment 4 Thanos Apostolou 2019-09-19 21:33:58 UTC
Here: https://imgur.com/a/ibaEKdV

When a gtk CSD is unfocused and focused.

I wanted to see if I can have the dark colored border only around the header bar and have a light one for the rest border when the window is focused, but it seems impossible (I don't know any theme doing something similar either).
Comment 5 Thanos Apostolou 2019-09-19 21:42:08 UTC
Also here are screenshots with the same modifications from the same machine which show that the borders are not used in plasma wayland and xfce which support shadows: https://imgur.com/a/sSSl4yV
Comment 6 Nate Graham 2019-09-21 22:03:05 UTC
Git commit 5ded281f8e5f99dd65b94e5ad759cbfc3da5cb00 by Nate Graham, on behalf of Carson Black.
Committed on 21/09/2019 at 22:02.
Pushed by ngraham into branch 'Plasma/5.17'.

[GTK3] CSD windows show handles on .solid-csd

Summary:
CSD windows will now show 5px handles on windows with .solid-csd (CSD windows in window managers that do not support GTK frame extents)
FIXED-IN: 5.17.0

Test Plan:
Handle before (KWin):
{F7396999}

Handle after (KWin):
{F7397796}

Reviewers: #breeze, ngraham, ndavis

Reviewed By: #breeze, ngraham, ndavis

Subscribers: ngraham, ndavis, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24126

M  +8    -2    src/gtk3/widgets/_window_decorations.scss

https://commits.kde.org/breeze-gtk/5ded281f8e5f99dd65b94e5ad759cbfc3da5cb00