Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port TabSwitcher, Show Desktop & Workspace applets over to libxfce4windowing #485

Merged
merged 11 commits into from
Oct 29, 2023
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- run: sudo add-apt-repository ppa:xubuntu-dev/experimental
- run: sudo apt update
- run: sudo apt remove libunwind-14-dev
- run: sudo apt install meson ninja-build zenity gnome-screensaver gnome-settings-daemon-dev gtk-doc-tools intltool libaccountsservice-dev libasound2-dev libcanberra-dev libcanberra-gtk3-dev libgee-0.8-dev libgnome-bluetooth-dev libgnome-desktop-3-dev libgnome-menu-3-dev libgtk-3-dev libibus-1.0-dev libmutter-10-dev libpeas-dev libpolkit-agent-1-dev libpulse-dev libupower-glib-dev libwnck-3-dev sassc uuid-dev valac libgstreamer1.0-dev libgee-0.8-dev
- run: sudo apt install meson ninja-build zenity gnome-screensaver gnome-settings-daemon-dev gtk-doc-tools intltool libaccountsservice-dev libasound2-dev libcanberra-dev libcanberra-gtk3-dev libgee-0.8-dev libgnome-bluetooth-dev libgnome-desktop-3-dev libgnome-menu-3-dev libgtk-3-dev libibus-1.0-dev libmutter-10-dev libpeas-dev libpolkit-agent-1-dev libpulse-dev libupower-glib-dev libwnck-3-dev sassc uuid-dev valac libgstreamer1.0-dev libgee-0.8-dev libxfce4windowing-0-dev
- run: meson build -Duse-old-zenity=true -Dwith-gnome-screensaver=true
- run: meson compile -C build
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "gvc"]
path = subprojects/gvc
url = https://gitlab.gnome.org/GNOME/libgnome-volume-control.git

3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ dep_accountsservice = dependency('accountsservice', version: '>= 0.6.55')
dep_canberra = dependency('libcanberra')
dep_canberra_gtk3 = dependency('libcanberra-gtk3')

# Needed for window tracking
dep_xfce4windowing = dependency('libxfce4windowing-0')

# Create config.h
cdata = configuration_data()

Expand Down
37 changes: 25 additions & 12 deletions src/appsys/AppSystem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ namespace Budgie {
}
}

public DesktopAppInfo? query_by_pid(int64 pid) {
if (pid in pid_cache) {
string filename = pid_cache[pid];
DesktopAppInfo? info = new DesktopAppInfo.from_filename(filename);
return info;
}

return null;
}

public DesktopAppInfo? query_by_xid(ulong xid) {
string? gtk_id = query_gtk_application_id(xid);
if (gtk_id == null) return null;
gtk_id = gtk_id.down() + ".desktop";
return desktops.get(gtk_id);
}

public DesktopAppInfo? query_window_by_xid(ulong xid) {
return query_window(Wnck.Window.@get(xid));
}

/**
* Attempt to gain the DesktopAppInfo relating to a given window
*/
Expand Down Expand Up @@ -170,20 +191,12 @@ namespace Budgie {
}

/* See if the pid associated with the window is in our pid cache */
if (pid in pid_cache) {
string filename = pid_cache[pid];
DesktopAppInfo? info = new DesktopAppInfo.from_filename(filename);
return info;
}
DesktopAppInfo? pid_info = query_by_pid(pid);
if (pid_info != null) return query_by_pid(pid);

/* Next, attempt to get the application based on the GtkApplication ID */
string? gtk_id = this.query_gtk_application_id(xid);
if (gtk_id != null) {
gtk_id = gtk_id.down() + ".desktop";
if (gtk_id in this.desktops) {
return this.desktops[gtk_id];
}
}
DesktopAppInfo? desktops_by_xid = query_by_xid(xid);
if (desktops_by_xid != null) return desktops_by_xid;

/* Is the group name in the simpletons? */
if (grp_name != null && grp_name.down() in this.simpletons) {
Expand Down
2 changes: 2 additions & 0 deletions src/daemon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ daemon_deps = [
dep_gdkx11,
dep_notify,
dep_wnck,
dep_xfce4windowing,
dep_gst,
dep_cairo,
link_libbudgieprivate,
Expand Down Expand Up @@ -86,6 +87,7 @@ executable(
'--pkg', 'gtk+-3.0',
'--pkg', 'gdk-x11-3.0',
'--pkg', 'libwnck-3.0',
'--pkg', 'libxfce4windowing-0',
# Make gresource work
'--target-glib=2.38',
'--gresources=' + gresource,
Expand Down
Loading