Skip to content

Commit

Permalink
Adapt to xf4w v4.19.8 (#630)
Browse files Browse the repository at this point in the history
* Adapt to xf4w v4.19.7

* Ensure we depend specifically on xf4w 4.19.7

* Add a metadata file plus custom file to allow generation of xf4w vapi correctly

* Update README instructions to build xf4w vapi
  • Loading branch information
fossfreedom authored Nov 11, 2024
1 parent afc7e42 commit a23ff6a
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 163 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dep_canberra = dependency('libcanberra')
dep_canberra_gtk3 = dependency('libcanberra-gtk3')

# Needed for window tracking
dep_xfce4windowing = dependency('libxfce4windowing-0')
dep_xfce4windowing = dependency('libxfce4windowing-0', version: '>= 4.19.7')

# Create config.h
cdata = configuration_data()
Expand Down
11 changes: 0 additions & 11 deletions src/daemon/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public static int main(string[] args) {
Budgie.ServiceManager? manager = null;
Budgie.EndSessionDialog? end_dialog = null;
Budgie.SettingsManager? settings = null;
Wnck.Screen? screen = null;

Intl.setlocale(LocaleCategory.ALL, "");
Intl.bindtextdomain(Budgie.GETTEXT_PACKAGE, Budgie.LOCALEDIR);
Expand All @@ -66,15 +65,6 @@ public static int main(string[] args) {
return 0;
}

/* Initialise wnck after gtk-start */
Idle.add(() => {
screen = Wnck.Screen.get_default();
if (screen != null) {
screen.force_update();
}
return false;
});

/* Initialize libnotify */
Notify.init("com.solus-project.budgie-daemon");

Expand All @@ -92,7 +82,6 @@ public static int main(string[] args) {
manager = null;
end_dialog = null;
settings = null;
screen = null;

return 0;
}
1 change: 0 additions & 1 deletion src/daemon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ executable(
'--pkg', 'gio-unix-2.0',
'--pkg', 'gtk+-3.0',
'--pkg', 'gdk-x11-3.0',
'--pkg', 'libwnck-3.0',
'--pkg', 'libxfce4windowing-0',
# Make gresource work
'--target-glib=2.38',
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/tabswitcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace Budgie {
window_box.unselect_child(current);

try {
tab.window.activate(get_time());
tab.window.activate(null, get_time());
} catch (GLib.Error e) {
warning("Failed to activate window: %s\n", e.message);
}
Expand Down
4 changes: 2 additions & 2 deletions src/panel/applets/icon-tasklist/IconTasklistApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public class IconTasklistApplet : Budgie.Applet {
} else {
try {
window.set_minimized(false);
window.activate(event.time);
window.activate(null, event.time);
} catch (Error e) {
warning("Unable to un-minimize or activate window '%s': %s", window.get_name(), e.message);
}
Expand All @@ -538,7 +538,7 @@ public class IconTasklistApplet : Budgie.Applet {
var window = group.get_last_active_window();

try {
window.activate(event.time);
window.activate(null, event.time);
} catch (Error e) {
warning("Unable to activate window %s: %s", window.get_name(), e.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private class WindowItem : Gtk.ListBoxRow {

name_button.clicked.connect(() => {
try {
window.activate(Gtk.get_current_event_time());
window.activate(null, Gtk.get_current_event_time());
} catch (Error e) {
warning("Unable to activate window %s: %s", window.get_name(), e.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/panel/applets/icon-tasklist/widgets/IconButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public class IconButton : Gtk.ToggleButton {

// Attempt to activate the target window
try {
target_window.activate(event.time);
target_window.activate(null, event.time);
} catch (Error e) {
warning("Error activating and unminimizing window '%s': %s", target_window.get_name(), e.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/panel/applets/workspaces/WindowIcon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace Workspaces {
if (event.button != 1) return Gdk.EVENT_STOP;

try {
window.activate(event.time);
window.activate(null, event.time);
} catch (Error e) {
warning("Failed to activate window: %s", e.message);
}
Expand Down
6 changes: 6 additions & 0 deletions vapi/Libxfce4windowing-0.0.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Window.activate.seat nullable=true
Workspace.get_workspace_group type="unowned libxfce4windowing.WorkspaceGroup?"
Application.get_instance skip=true
Workspace.assign_to_workspace_group skip=true
Window.get_screen type="unowned libxfce4windowing.Screen"
WorkspaceGroup.get_workspace_manager type="unowned libxfce4windowing.WorkspaceManager"
3 changes: 1 addition & 2 deletions vapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Then have fun un-mangling it to support vala async syntax.
To generate the libxfce4windowing vapi files:

```bash
vapigen --library libxfce4windowing-0 /usr/share/gir-1.0/Libxfce4windowing-0-0.gir --metadatadir .
```
vapigen --library libxfce4windowing-0 /usr/share/gir-1.0/Libxfce4windowing-0.0.gir --girdir . -d . --metadatadir . --vapidir . libxfce4windowing-0-custom.vala```
### UPower
Expand Down
Empty file modified vapi/generate-magpie-vapi.sh
100644 → 100755
Empty file.
13 changes: 13 additions & 0 deletions vapi/libxfce4windowing-0-custom.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace libxfce4windowing {
[CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwApplication", type_id = "xfw_application_get_type ()")]
public abstract class Application : GLib.Object {
[CCode (cname = "xfw_application_get_instance")]
public unowned libxfce4windowing.ApplicationInstance? get_instance (libxfce4windowing.Window window);
}

[CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspace", type_id = "xfw_workspace_get_type ()")]
public interface Workspace : GLib.Object {
[CCode (cname = "xfw_workspace_assign_to_workspace_group")]
public bool assign_to_workspace_group (libxfce4windowing.WorkspaceGroup group) throws GLib.Error;
}
}
Loading

0 comments on commit a23ff6a

Please sign in to comment.