Skip to content

Commit 5cbdda2

Browse files
committed
deps: Update libxfce4windowing VAPI
In the latest version, only the Xfw namespace/prefix is supported, so this switches everything over to it. This has the added benefit of being way quicker and easier to type. Signed-off-by: Evan Maddock <[email protected]>
1 parent d460e19 commit 5cbdda2

File tree

19 files changed

+229
-240
lines changed

19 files changed

+229
-240
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dep_canberra = dependency('libcanberra')
6363
dep_canberra_gtk3 = dependency('libcanberra-gtk3')
6464

6565
# Needed for window tracking
66-
dep_xfce4windowing = dependency('libxfce4windowing-0', version: '>= 4.19.7')
66+
dep_xfce4windowing = dependency('libxfce4windowing-0', version: '>= 4.20.1')
6767

6868
# Needed for upower interaction
6969
dep_upower = dependency('upower-glib', version: '>= 0.99.8')

src/daemon/manager.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ namespace Budgie {
2222
*/
2323
[SingleInstance]
2424
public class WaylandClient : GLib.Object {
25-
private unowned libxfce4windowing.Monitor? primary_monitor=null;
25+
private unowned Xfw.Monitor? primary_monitor=null;
2626

2727
public bool is_initialised() { return primary_monitor != null; }
2828
public unowned Gdk.Monitor gdk_monitor {get; private set; }
2929
public Gdk.Rectangle monitor_res { get; private set; }
3030

3131
public WaylandClient() {
3232
if (primary_monitor != null) return;
33-
libxfce4windowing.Screen.get_default().monitors_changed.connect(on_monitors_changed);
33+
Xfw.Screen.get_default().monitors_changed.connect(on_monitors_changed);
3434
on_monitors_changed();
3535
}
3636

@@ -42,7 +42,7 @@ namespace Budgie {
4242
don't try indefinitely
4343
*/
4444
Timeout.add(200, ()=> {
45-
primary_monitor = libxfce4windowing.Screen.get_default().get_primary_monitor();
45+
primary_monitor = Xfw.Screen.get_default().get_primary_monitor();
4646
if (primary_monitor != null || loop++ > 10) {
4747
monitor_res = primary_monitor.get_logical_geometry();
4848
gdk_monitor = primary_monitor.get_gdk_monitor();

src/daemon/tabswitcher.vala

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
using Gdk;
1414
using Gtk;
15-
using libxfce4windowing;
15+
using Xfw;
1616

1717
namespace Budgie {
1818
public const string SHOW_ALL_WINDOWS_KEY = "show-all-windows-tabswitcher";
@@ -47,18 +47,18 @@ namespace Budgie {
4747
public class TabSwitcherWidget : Gtk.FlowBoxChild {
4848
private Gtk.Image image;
4949
private uint64 activation_timestamp;
50-
private libxfce4windowing.Application? application;
50+
private Xfw.Application? application;
5151
private DesktopAppInfo? info;
5252
public string id;
5353
public string title;
5454

55-
public unowned libxfce4windowing.Window? window = null;
55+
public unowned Xfw.Window? window = null;
5656

5757
public signal void closed(TabSwitcherWidget widget);
58-
public signal void window_activated(libxfce4windowing.Window window);
58+
public signal void window_activated(Xfw.Window window);
5959
public signal void workspace_changed();
6060

61-
public TabSwitcherWidget(Budgie.AppSystem app_system, libxfce4windowing.Window? win) {
61+
public TabSwitcherWidget(Budgie.AppSystem app_system, Xfw.Window? win) {
6262
Object();
6363
window = win;
6464
ulong uid = (ulong) window.x11_get_xid();
@@ -68,7 +68,7 @@ namespace Budgie {
6868
application = win.get_application();
6969

7070
// Running under X11
71-
if (libxfce4windowing.windowing_get() == libxfce4windowing.Windowing.X11) {
71+
if (Xfw.windowing_get() == Xfw.Windowing.X11) {
7272
info = app_system.query_window_by_xid((ulong)uid);
7373
}
7474

@@ -82,8 +82,8 @@ namespace Budgie {
8282

8383
window.state_changed.connect((changed_mask, new_state) => {
8484
if (
85-
(libxfce4windowing.WindowState.ACTIVE in changed_mask) &&
86-
(libxfce4windowing.WindowState.ACTIVE in new_state)
85+
(Xfw.WindowState.ACTIVE in changed_mask) &&
86+
(Xfw.WindowState.ACTIVE in new_state)
8787
) {
8888
activation_timestamp = get_time();
8989
window_activated(window);
@@ -127,11 +127,11 @@ namespace Budgie {
127127
[GtkChild]
128128
private unowned Label window_title;
129129

130-
private libxfce4windowing.Workspace? active_workspace = null;
131-
private unowned libxfce4windowing.WorkspaceGroup? workspace_group = null;
130+
private Xfw.Workspace? active_workspace = null;
131+
private unowned Xfw.WorkspaceGroup? workspace_group = null;
132132
private Gdk.Screen? default_screen;
133-
private libxfce4windowing.Screen xfce_screen;
134-
private unowned libxfce4windowing.WorkspaceManager workspace_manager;
133+
private Xfw.Screen xfce_screen;
134+
private unowned Xfw.WorkspaceManager workspace_manager;
135135
private Budgie.AppSystem? app_system = null;
136136

137137
private Gdk.Monitor primary_monitor;
@@ -163,7 +163,7 @@ namespace Budgie {
163163

164164
default_screen = Gdk.Screen.get_default();
165165

166-
xfce_screen = libxfce4windowing.Screen.get_default();
166+
xfce_screen = Xfw.Screen.get_default();
167167

168168
xfce_screen.get_windows().foreach(add_window);
169169
xfce_screen.window_opened.connect(add_window);
@@ -212,7 +212,7 @@ namespace Budgie {
212212
window_box.invalidate_filter(); // Re-filter
213213
}
214214

215-
private void add_window(libxfce4windowing.Window window) {
215+
private void add_window(Xfw.Window window) {
216216
if (window.is_skip_pager() || window.is_skip_tasklist()) return;
217217

218218
var window_widget = new TabSwitcherWidget(app_system, window);
@@ -333,7 +333,7 @@ namespace Budgie {
333333
update_sizing();
334334
}
335335

336-
private void set_window_as_activated(libxfce4windowing.Window window) {
336+
private void set_window_as_activated(Xfw.Window window) {
337337
string id = ((ulong) window.x11_get_xid()).to_string();
338338
unowned List<string> entries = recency.find_custom(id, strcmp);
339339
recency.remove_link(entries);
@@ -356,15 +356,15 @@ namespace Budgie {
356356
move_switcher();
357357
}
358358

359-
private bool window_on_active_workspace(libxfce4windowing.Window window) {
360-
unowned libxfce4windowing.Workspace? win_workspace = window.get_workspace(); // Get workspace
359+
private bool window_on_active_workspace(Xfw.Window window) {
360+
unowned Xfw.Workspace? win_workspace = window.get_workspace(); // Get workspace
361361
if (active_workspace == null || win_workspace == null) return true;
362362
return win_workspace.get_id() == active_workspace.get_id();
363363
}
364364

365365
/* Switch focus to the item with the xid */
366366
public void focus_item(bool backwards) {
367-
unowned libxfce4windowing.Window? active_window = xfce_screen.get_active_window();
367+
unowned Xfw.Window? active_window = xfce_screen.get_active_window();
368368
TabSwitcherWidget? widget = active_window != null ? ids.get(((ulong) active_window.x11_get_xid()).to_string()) : null;
369369

370370
// Visible, each input should cycle to previous / next

src/dialogs/polkit/polkitdialog.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ namespace Budgie {
149149
combobox_idents.set_id_column(0);
150150

151151
// center dialog on the primary screen
152-
var primary_monitor = libxfce4windowing.Screen.get_default().get_primary_monitor();
152+
var primary_monitor = Xfw.Screen.get_default().get_primary_monitor();
153153
GtkLayerShell.init_for_window(this);
154154
GtkLayerShell.set_layer(this, GtkLayerShell.Layer.TOP);
155155
GtkLayerShell.set_monitor(this, primary_monitor.get_gdk_monitor());

src/dialogs/screenshot/screenshot.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ namespace Budgie {
4343
*/
4444
[SingleInstance]
4545
public class WaylandClient : GLib.Object {
46-
private unowned libxfce4windowing.Monitor? primary_monitor=null;
46+
private unowned Xfw.Monitor? primary_monitor=null;
4747

4848
public unowned Gdk.Monitor gdk_monitor {get; private set; }
4949
public int scale { get; private set; }
5050

5151
public WaylandClient() {
5252
if (primary_monitor != null) return;
53-
libxfce4windowing.Screen.get_default().monitors_changed.connect(on_monitors_changed);
53+
Xfw.Screen.get_default().monitors_changed.connect(on_monitors_changed);
5454
on_monitors_changed();
5555
}
5656

@@ -62,7 +62,7 @@ namespace Budgie {
6262
don't try indefinitely
6363
*/
6464
Timeout.add_seconds(1, ()=> {
65-
primary_monitor = libxfce4windowing.Screen.get_default().get_primary_monitor();
65+
primary_monitor = Xfw.Screen.get_default().get_primary_monitor();
6666
if (primary_monitor != null || loop++ > 10) {
6767
gdk_monitor = primary_monitor.get_gdk_monitor();
6868
scale = (int)primary_monitor.get_scale();

src/panel/applets/icon-tasklist/IconTasklistApplet.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public class IconTasklistApplet : Budgie.Applet {
455455
button.update();
456456
}
457457

458-
private void on_active_window_changed(libxfce4windowing.Window? old_active_window, libxfce4windowing.Window? new_active_window) {
458+
private void on_active_window_changed(Xfw.Window? old_active_window, Xfw.Window? new_active_window) {
459459
foreach (IconButton button in buttons.get_values()) {
460460
if (new_active_window != null && button.has_window(new_active_window)) {
461461
button.set_active_window(true);

src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public class ButtonPopover : Gtk.Popover {
184184
}
185185
}
186186

187-
public void add_window(libxfce4windowing.Window window) {
187+
public void add_window(Xfw.Window window) {
188188
var window_item = new WindowItem(window);
189189

190190
window_item.page_switch_clicked.connect(() => {
@@ -204,7 +204,7 @@ public class ButtonPopover : Gtk.Popover {
204204
windows.add(window_item);
205205
}
206206

207-
public void remove_window(libxfce4windowing.Window window) {
207+
public void remove_window(Xfw.Window window) {
208208
string window_id = window.get_class_ids()[0];
209209
WindowItem? window_item = null;
210210

@@ -239,15 +239,15 @@ public class ButtonPopover : Gtk.Popover {
239239
}
240240

241241
private class WindowControls : Gtk.Box {
242-
public libxfce4windowing.Window window { get; construct; }
242+
public Xfw.Window window { get; construct; }
243243

244244
private Gtk.Button? maximize_button;
245245
private Gtk.Button? minimize_button;
246246
private Gtk.Button? return_button;
247247

248248
public signal void return_clicked();
249249

250-
public WindowControls(libxfce4windowing.Window window) {
250+
public WindowControls(Xfw.Window window) {
251251
Object(window: window, orientation: Gtk.Orientation.VERTICAL, spacing: 0);
252252
}
253253

@@ -302,7 +302,7 @@ private class WindowControls : Gtk.Box {
302302
});
303303

304304
window.state_changed.connect((changed_mask, new_state) => {
305-
if (libxfce4windowing.WindowState.MAXIMIZED in changed_mask) {
305+
if (Xfw.WindowState.MAXIMIZED in changed_mask) {
306306
update_maximize_label();
307307
}
308308
});
@@ -354,7 +354,7 @@ private class WindowControls : Gtk.Box {
354354
}
355355

356356
private class WindowItem : Gtk.ListBoxRow {
357-
public libxfce4windowing.Window window { get; construct; }
357+
public Xfw.Window window { get; construct; }
358358

359359
private Gtk.Label? name_label;
360360
private Gtk.Button? name_button;
@@ -363,7 +363,7 @@ private class WindowItem : Gtk.ListBoxRow {
363363

364364
public signal void page_switch_clicked();
365365

366-
public WindowItem(libxfce4windowing.Window window) {
366+
public WindowItem(Xfw.Window window) {
367367
Object(window: window);
368368
}
369369

src/panel/applets/icon-tasklist/widgets/IconButton.vala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class IconButton : Gtk.ToggleButton {
135135
*
136136
* Throws: if the button geometry could not be set
137137
*/
138-
private void set_window_button_geometry(libxfce4windowing.Window window) throws Error {
138+
private void set_window_button_geometry(Xfw.Window window) throws Error {
139139
int x, y;
140140
var toplevel = get_toplevel();
141141

@@ -162,7 +162,7 @@ public class IconButton : Gtk.ToggleButton {
162162
// Nothing to do if there are no open windows
163163
if (window_group == null) return Gdk.EVENT_STOP;
164164

165-
unowned libxfce4windowing.Window target_window = null;
165+
unowned Xfw.Window target_window = null;
166166

167167
// Get the currently active window in the group
168168
unowned var active_window = window_group?.get_active_window();
@@ -220,13 +220,13 @@ public class IconButton : Gtk.ToggleButton {
220220
int width = definite_allocation.width;
221221
int height = definite_allocation.height;
222222

223-
List<unowned libxfce4windowing.Window> windows;
223+
List<unowned Xfw.Window> windows;
224224

225225
// Get the windows in this group, if any
226226
if (window_group != null && window_group.has_windows()) {
227227
windows = window_group.get_windows();
228228
} else {
229-
windows = new List<unowned libxfce4windowing.Window>();
229+
windows = new List<unowned Xfw.Window>();
230230
}
231231

232232
// No indicators if there are no windows
@@ -387,13 +387,13 @@ public class IconButton : Gtk.ToggleButton {
387387
int width = definite_allocation.width;
388388
int height = definite_allocation.height;
389389

390-
List<unowned libxfce4windowing.Window> windows;
390+
List<unowned Xfw.Window> windows;
391391

392392
// Get the windows in this group, if any
393393
if (window_group != null && window_group.has_windows()) {
394394
windows = window_group.get_windows();
395395
} else {
396-
windows = new List<unowned libxfce4windowing.Window>();
396+
windows = new List<unowned Xfw.Window>();
397397
}
398398

399399
// No windows, no indicators
@@ -501,7 +501,7 @@ public class IconButton : Gtk.ToggleButton {
501501
}
502502
}
503503

504-
public bool has_window(libxfce4windowing.Window window) {
504+
public bool has_window(Xfw.Window window) {
505505
return window_group != null && window_group.has_window(window);
506506
}
507507

@@ -599,11 +599,11 @@ public class IconButton : Gtk.ToggleButton {
599599
popover.add_window(window);
600600

601601
window.state_changed.connect((changed_mask, new_state) => {
602-
if (!(libxfce4windowing.WindowState.URGENT in changed_mask)) {
602+
if (!(Xfw.WindowState.URGENT in changed_mask)) {
603603
return;
604604
}
605605

606-
urgent = (new_state & libxfce4windowing.WindowState.URGENT) != 0;
606+
urgent = (new_state & Xfw.WindowState.URGENT) != 0;
607607

608608
set_urgent(urgent);
609609
});

src/panel/applets/show-desktop/ShowDesktopApplet.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ShowDesktopPlugin : Budgie.Plugin, Peas.ExtensionBase {
1818
public class ShowDesktopApplet : Budgie.Applet {
1919
protected Gtk.ToggleButton widget;
2020
protected Gtk.Image img;
21-
private libxfce4windowing.Screen xfce_screen;
21+
private Xfw.Screen xfce_screen;
2222

2323
public ShowDesktopApplet() {
2424
widget = new Gtk.ToggleButton();
@@ -28,7 +28,7 @@ public class ShowDesktopApplet : Budgie.Applet {
2828
widget.add(img);
2929
widget.set_tooltip_text(_("Toggle the desktop"));
3030

31-
xfce_screen = libxfce4windowing.Screen.get_default();
31+
xfce_screen = Xfw.Screen.get_default();
3232

3333
xfce_screen.window_opened.connect((window) => {
3434
if (window.is_skip_pager() || window.is_skip_tasklist()) return;
@@ -48,7 +48,7 @@ public class ShowDesktopApplet : Budgie.Applet {
4848
try {
4949
window.set_minimized(!showing_desktop);
5050
} catch (Error e) {
51-
// Note: This is intentionally set to debug instead of warning because libxfce4windowing will create noise otherwise
51+
// Note: This is intentionally set to debug instead of warning because Xfw will create noise otherwise
5252
// Unminimize operations can end up being noisy when they fail due to the window not yet reporting the capability to support CAN_MINIMIZE
5353
// https://gitlab.xfce.org/xfce/libxfce4windowing/-/blob/main/libxfce4windowing/xfw-window-x11.c#L363
5454
debug("Failed to change state of window \"%s\": %s", window.get_name(), e.message);

src/panel/applets/workspaces/WindowIcon.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Workspaces {
1414
public const string FALLBACK_ICON_NAME = "image-missing";
1515

1616
public class WindowIcon : Gtk.Button {
17-
public libxfce4windowing.Window window { get; construct; }
17+
public Xfw.Window window { get; construct; }
1818

1919
construct {
2020
this.set_relief(Gtk.ReliefStyle.NONE);
@@ -63,7 +63,7 @@ namespace Workspaces {
6363
this.show_all();
6464
}
6565

66-
public WindowIcon(libxfce4windowing.Window window) {
66+
public WindowIcon(Xfw.Window window) {
6767
Object(window: window);
6868
}
6969

0 commit comments

Comments
 (0)