Skip to content

Commit c065dce

Browse files
authored
Ported to GTK4 (#290)
1 parent aaadead commit c065dce

75 files changed

Lines changed: 2712 additions & 1815 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,35 @@ jobs:
77
runs-on: ubuntu-latest
88
container: alpine:latest
99
steps:
10-
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
11-
- run: apk --no-cache add git g++ binutils pkgconf meson ninja musl-dev gtk+3.0-dev gtkmm3-dev wayland-protocols wayfire-dev gtk-layer-shell-dev pulseaudio-dev libdbusmenu-gtk3-dev alsa-lib-dev
12-
- name: wf-shell
13-
uses: actions/checkout@v2
14-
with:
15-
repository: WayfireWM/wf-shell
16-
path: wf-shell
17-
- run: cd wf-shell && meson build --prefix=/usr && ninja -v -C build && ninja -v -C build install && cd ..
10+
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/v3.22/community' > /etc/apk/repositories
11+
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/v3.22/main' >> /etc/apk/repositories
12+
- run: apk --no-cache add git g++ binutils pkgconf meson ninja musl-dev gtkmm4-dev vala gobject-introspection gobject-introspection-dev pulseaudio-dev libdbusmenu-glib-dev alsa-lib-dev
13+
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
14+
- run: echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
15+
- run: apk --no-cache add wayland-protocols wayfire-dev gtk4-layer-shell-dev gtk4-layer-shell
16+
17+
- name: wf-shell
18+
uses: actions/checkout@v2
19+
with:
20+
repository: WayfireWM/wf-shell
21+
path: wf-shell
22+
- run: cd wf-shell && meson setup build --prefix=/usr && ninja -v -C build && ninja -v -C build install && cd ..
1823
test_code_style:
1924
name: "Check code style with uncrustify"
2025
runs-on: ubuntu-latest
2126
steps:
22-
- run: sudo apt-get update
23-
- run: sudo apt-get install -y git cmake gcc make
24-
- name: Build Uncrustify
25-
uses: actions/checkout@v2
26-
with:
27-
repository: ammen99/uncrustify
28-
path: uncrustify
29-
- run: cd uncrustify && mkdir build && cd build && cmake .. && make && cd ../..
30-
- name: Run Uncrustify Check
31-
uses: actions/checkout@v2
32-
with:
33-
path: wf-shell
34-
- run: cd wf-shell && wget https://raw.githubusercontent.com/WayfireWM/wayfire/master/uncrustify.ini
35-
- run: cd wf-shell && git ls-files | grep "hpp$\|cpp$" | xargs ../uncrustify/build/uncrustify -c uncrustify.ini --no-backup --replace
36-
- run: cd wf-shell && git diff --exit-code
27+
- run: sudo apt-get update
28+
- run: sudo apt-get install -y git cmake gcc make
29+
- name: Build Uncrustify
30+
uses: actions/checkout@v2
31+
with:
32+
repository: ammen99/uncrustify
33+
path: uncrustify
34+
- run: cd uncrustify && mkdir build && cd build && cmake .. && make && cd ../..
35+
- name: Run Uncrustify Check
36+
uses: actions/checkout@v2
37+
with:
38+
path: wf-shell
39+
- run: cd wf-shell && wget https://raw.githubusercontent.com/WayfireWM/wayfire/master/uncrustify.ini
40+
- run: cd wf-shell && git ls-files | grep "hpp$\|cpp$" | xargs ../uncrustify/build/uncrustify -c uncrustify.ini --no-backup --replace
41+
- run: cd wf-shell && git diff --exit-code

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[submodule "subprojects/gtk-layer-shell"]
2-
path = subprojects/gtk-layer-shell
3-
url = https://github.com/wmww/gtk-layer-shell
41
[submodule "subprojects/gvc"]
52
path = subprojects/gvc
63
url = https://github.com/GNOME/libgnome-volume-control
74
[submodule "subprojects/wayland-logout"]
85
path = subprojects/wayland-logout
96
url = https://github.com/soreau/wayland-logout
7+
[submodule "subprojects/gtk4-layer-shell"]
8+
path = subprojects/gtk4-layer-shell
9+
url = https://github.com/wmww/gtk4-layer-shell.git

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Currently it has only a GTK-based panel and background client.
55

66
# Dependencies
77

8-
wf-shell needs the core wayland libraries and protocols (`wayland-devel` and `wayland-protocols-devel` for Fedora), gtkmm-3.0 and [wf-config](https://github.com/WayfireWM/wf-config)
8+
wf-shell needs the core wayland libraries and protocols (`wayland-devel` and `wayland-protocols-devel` for Fedora), gtkmm-4.0 and [wf-config](https://github.com/WayfireWM/wf-config)
99

1010
# Build
1111

data/css/default.css

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,100 @@
5959

6060
.wf-panel .command-output.icon-bottom label {
6161
padding-bottom: 5px;
62-
}
62+
}
63+
64+
.excellent {
65+
color: #00ff00;
66+
}
67+
68+
.good {
69+
color: #88ff00;
70+
}
71+
72+
.ok {
73+
color: #ffff00;
74+
}
75+
76+
.weak {
77+
color: #ff8800;
78+
}
79+
80+
.none {
81+
color: #ff0000;
82+
}
83+
84+
.wf-dock,
85+
.wf-dock .out-box {
86+
background: transparent;
87+
}
88+
89+
.wf-dock .box {
90+
padding-left: 1em;
91+
padding-right: 1em;
92+
border-radius: 1em;
93+
}
94+
95+
.wf-dock image {
96+
transition: 200ms;
97+
-gtk-icon-transform: scale(1.0);
98+
padding-left: 1rem;
99+
padding-right: 1rem;
100+
}
101+
102+
.wf-dock image:hover {
103+
transition: 200ms;
104+
-gtk-icon-transform: scale(1.3);
105+
padding-left: 2rem;
106+
padding-right: 2rem;
107+
}
108+
109+
.wf-dock .minimized image {
110+
-gtk-icon-filter: grayscale(1);
111+
}
112+
113+
.wf-dock image {
114+
animation-name: embiggen;
115+
animation-duration: 1000ms;
116+
animation-timing-function: linear;
117+
animation-iteration-count: 1;
118+
}
119+
120+
.wf-dock .closing image {
121+
animation-name: kromulent;
122+
animation-duration: 1000ms;
123+
animation-timing-function: linear;
124+
animation-iteration-count: 1;
125+
animation-fill-mode: forwards;
126+
}
127+
128+
@keyframes embiggen {
129+
to {
130+
-gtk-icon-size: 64px;
131+
-gtk-icon-transform: translateY(0px);
132+
padding-left: 1rem;
133+
padding-right: 1rem;
134+
}
135+
136+
from {
137+
-gtk-icon-size: 0px;
138+
-gtk-icon-transform: translateY(64px);
139+
padding-left: 0rem;
140+
padding-right: 0rem;
141+
}
142+
}
143+
144+
@keyframes kromulent {
145+
from {
146+
-gtk-icon-size: 64px;
147+
-gtk-icon-transform: translateY(0px);
148+
padding-left: 1rem;
149+
padding-right: 1rem;
150+
}
151+
152+
to {
153+
-gtk-icon-size: 0px;
154+
-gtk-icon-transform: translateY(64px);
155+
padding-left: 0rem;
156+
padding-right: 0rem;
157+
}
158+
}

data/css/meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
install_data('default.css', install_dir: join_paths(resource_dir, 'css'))
1+
css_path = join_paths(resource_dir, 'css')
2+
3+
install_data('default.css', install_dir: css_path)
4+
install_data('panel-battery-zoom-hover.css', install_dir: css_path)
5+
install_data('panel-launchers-zoom-hover.css', install_dir: css_path)
6+
install_data('panel-menu-button-small.css', install_dir: css_path)
7+
install_data('panel-menu-zoom-hover.css', install_dir: css_path)
8+
install_data('panel-network-zoom-hover.css', install_dir: css_path)
9+
install_data('panel-selectors.css', install_dir: css_path)
10+
install_data('panel-tray-zoom-hover.css', install_dir: css_path)
11+
install_data('panel-volume-zoom-hover.css', install_dir: css_path)
12+
install_data('panel-window-list-zoom-hover.css', install_dir: css_path)
13+
install_data('user-font.css', install_dir: css_path)

meson.build

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,55 @@
11
project(
22
'wf-shell',
3-
'c',
3+
'c',
44
'cpp',
55
version: '0.10.0',
66
license: 'MIT',
77
meson_version: '>=0.51.0',
88
default_options: [
99
'cpp_std=c++17',
10-
'c_std=c11',
10+
'c_std=c11',
1111
'warning_level=2',
1212
'werror=false',
1313
],
1414
)
1515

16-
wayfire = dependency('wayfire')
16+
wayfire = dependency('wayfire')
1717
wayland_client = dependency('wayland-client')
1818
wayland_protos = dependency('wayland-protocols')
19-
gtkmm = dependency('gtkmm-3.0', version: '>=3.24')
20-
wfconfig = dependency('wf-config', version: '>=0.7.0') #TODO fallback submodule
21-
gtklayershell = dependency('gtk-layer-shell-0', version: '>= 0.6', fallback: ['gtk-layer-shell', 'gtk_layer_shell'])
22-
libpulse = dependency('libpulse', required : get_option('pulse'))
23-
dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4')
24-
libgvc = subproject('gvc', default_options: ['static=true'], required : get_option('pulse'))
19+
gtkmm = dependency('gtkmm-4.0', version: '>=4.12')
20+
wfconfig = dependency('wf-config', version: '>=0.7.0') #TODO fallback submodule
21+
epoxy = dependency('epoxy')
22+
gtklayershell = dependency('gtk4-layer-shell')
23+
libpulse = dependency('libpulse', required: get_option('pulse'))
24+
dbusmenu_gtk = dependency('dbusmenu-glib-0.4')
25+
libgvc = subproject('gvc', default_options: ['static=true'], required: get_option('pulse'))
2526

2627
if get_option('wayland-logout') == true
27-
wayland_logout = subproject('wayland-logout')
28+
wayland_logout = subproject('wayland-logout')
2829
endif
2930

3031
if libpulse.found()
31-
libgvc = libgvc.get_variable('libgvc_dep')
32-
add_project_arguments('-DHAVE_PULSE=1', language : 'cpp')
32+
libgvc = libgvc.get_variable('libgvc_dep')
33+
add_project_arguments('-DHAVE_PULSE=1', language: 'cpp')
3334
endif
3435

3536
needs_libinotify = ['freebsd', 'dragonfly'].contains(host_machine.system())
36-
libinotify = dependency('libinotify', required: needs_libinotify)
37+
libinotify = dependency('libinotify', required: needs_libinotify)
3738

38-
add_project_arguments(['-Wno-pedantic', '-Wno-unused-parameter', '-Wno-parentheses'], language: 'cpp')
39+
add_project_arguments(
40+
['-Wno-pedantic', '-Wno-unused-parameter', '-Wno-parentheses'],
41+
language: 'cpp',
42+
)
3943

4044
resource_dir = join_paths(get_option('prefix'), 'share', 'wayfire')
4145
metadata_dir = join_paths(resource_dir, 'metadata', 'wf-shell')
4246
sysconf_dir = join_paths(get_option('prefix'), get_option('sysconfdir'))
4347

4448
icon_dir = join_paths(get_option('prefix'), 'share', 'wayfire', 'icons')
45-
add_project_arguments('-DICONDIR="' + icon_dir + '"', language : 'cpp')
46-
add_project_arguments('-DRESOURCEDIR="' + resource_dir + '"', language : 'cpp')
47-
add_project_arguments('-DMETADATA_DIR="' + metadata_dir + '"', language : 'cpp')
48-
add_project_arguments('-DSYSCONF_DIR="' + sysconf_dir + '"', language : 'cpp')
49+
add_project_arguments('-DICONDIR="' + icon_dir + '"', language: 'cpp')
50+
add_project_arguments('-DRESOURCEDIR="' + resource_dir + '"', language: 'cpp')
51+
add_project_arguments('-DMETADATA_DIR="' + metadata_dir + '"', language: 'cpp')
52+
add_project_arguments('-DSYSCONF_DIR="' + sysconf_dir + '"', language: 'cpp')
4953

5054
subdir('metadata')
5155
subdir('proto')

meson_options.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
option('pulse', type: 'feature', value: 'auto', description: 'Build pulseaudio volume widget')
2-
option('wayland-logout', type: 'boolean', value: 'true', description: 'Install wayland-logout')
1+
option(
2+
'pulse',
3+
type: 'feature',
4+
value: 'auto',
5+
description: 'Build pulseaudio volume widget',
6+
)
7+
option(
8+
'wayland-logout',
9+
type: 'boolean',
10+
value: true,
11+
description: 'Install wayland-logout',
12+
)

metadata/dock.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,10 @@
4040
<_long>The distance from the cursor to the edge of screen to show the panel when it's hidden.</_long>
4141
<default>20</default>
4242
</option>
43+
<option name="show_close" type="bool">
44+
<_short>Show Close Animations</_short>
45+
<_long>Keep all window icons for up to 2 seconds to allow CSS animations.</_long>
46+
<default>true</default>
47+
</option>
4348
</plugin>
4449
</wf-shell>

metadata/panel.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ Set to -1 to only run it by clicking the button.
351351
<_short>Middle Click Closes Windows</_short>
352352
<default>false</default>
353353
</option>
354+
<option name="window_list_size" type="int">
355+
<_short>Window List Size</_short>
356+
<default>192</default>
357+
<min>1</min>
358+
</option>
354359
</group>
355360
</plugin>
356361
</wf-shell>

0 commit comments

Comments
 (0)