Skip to content

Commit

Permalink
Port TabSwitcher, Show Desktop & Workspace applets over to libxfce4wi…
Browse files Browse the repository at this point in the history
…ndowing (#485)

* Port TabSwitcher over to libxfce4windowing

This PR ports our TabSwitcher over to libxfce4windowing from using libwnck directly. To facilitate this, considerable amounts of the code was gutted or rewritten, for example wm no longer does any sort of cur_tabs tracking. That is left up to TabSwitcher.

Instead of rebuilding tabswitcher contents every single time we invoke it, we allow it to handle its own state and handle changes based on libxfce4windowing events. Windows are added / removed automatically, workspace handling is done to support show-all-windows function and workspace swapping, and we leverage sort with our recency list and filter to know when to hide items.

* ci: change package name for libxfce4windowing devel

* Port Show Desktop applet to libxfce4windowing

Fixes #471

* Port Workspace applet

Fixes #470

* Fix typo in signal

Co-authored-by: Evan Maddock <[email protected]>

* Use construct on TabSwitcherWindow

Co-authored-by: Evan Maddock <[email protected]>

* Remove unnecessary workspace switch code.

Use warning and document backwards / forwards logic.

* Make TabSwitcherSwitch sub-class Gtk.FlowBoxChild

* Clean up bit mask checking

Co-authored-by: Evan Maddock <[email protected]>

* Use down var already defined

Co-authored-by: Evan Maddock <[email protected]>

* Cleanup extra newline

Co-authored-by: Evan Maddock <[email protected]>

---------

Co-authored-by: Evan Maddock <[email protected]>
  • Loading branch information
JoshStrobl and EbonJaeger committed Oct 29, 2023
1 parent 077c281 commit 74b6564
Show file tree
Hide file tree
Showing 15 changed files with 1,044 additions and 473 deletions.
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

0 comments on commit 74b6564

Please sign in to comment.