a040ccb.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. From a040ccb96094f1d3a1ee81a6733c9434722bdf6c Mon Sep 17 00:00:00 2001
  2. From: Evan Maddock <5157277+EbonJaeger@users.noreply.github.com>
  3. Date: Sat, 2 Mar 2024 09:54:41 -0500
  4. Subject: [PATCH] vapi: Update libxfce4windowing to 4.19.3 (#547)
  5. Fixes #546
  6. Signed-off-by: Evan Maddock <maddock.evan@vivaldi.net>
  7. ---
  8. src/daemon/tabswitcher.vala | 6 +--
  9. src/panel/applets/workspaces/WindowIcon.vala | 2 +-
  10. .../applets/workspaces/WorkspaceItem.vala | 2 +-
  11. .../applets/workspaces/WorkspacesApplet.vala | 6 +--
  12. vapi/README.md | 33 +++++++++---
  13. vapi/libxfce4windowing-0.deps | 1 +
  14. vapi/libxfce4windowing-0.vapi | 52 ++++++++++++++-----
  15. 7 files changed, 75 insertions(+), 27 deletions(-)
  16. diff --git a/src/daemon/tabswitcher.vala b/src/daemon/tabswitcher.vala
  17. index 8aa97db6d..d7dbd8286 100644
  18. --- a/src/daemon/tabswitcher.vala
  19. +++ b/src/daemon/tabswitcher.vala
  20. @@ -61,7 +61,7 @@ namespace Budgie {
  21. public TabSwitcherWidget(Budgie.AppSystem app_system, libxfce4windowing.Window? win) {
  22. Object();
  23. window = win;
  24. - var uid = window.get_id();
  25. + ulong uid = (ulong) window.x11_get_xid();
  26. id = uid.to_string();
  27. set_title();
  28. @@ -334,7 +334,7 @@ namespace Budgie {
  29. }
  30. private void set_window_as_activated(libxfce4windowing.Window window) {
  31. - string id = window.get_id().to_string();
  32. + string id = ((ulong) window.x11_get_xid()).to_string();
  33. unowned List<string> entries = recency.find_custom(id, strcmp);
  34. recency.remove_link(entries);
  35. recency.prepend(id);
  36. @@ -365,7 +365,7 @@ namespace Budgie {
  37. /* Switch focus to the item with the xid */
  38. public void focus_item(bool backwards) {
  39. unowned libxfce4windowing.Window? active_window = xfce_screen.get_active_window();
  40. - TabSwitcherWidget? widget = active_window != null ? ids.get(active_window.get_id().to_string()) : null;
  41. + TabSwitcherWidget? widget = active_window != null ? ids.get(((ulong) active_window.x11_get_xid()).to_string()) : null;
  42. // Visible, each input should cycle to previous / next
  43. if (visible) {
  44. diff --git a/src/panel/applets/workspaces/WindowIcon.vala b/src/panel/applets/workspaces/WindowIcon.vala
  45. index a9efc0232..7e36cafe0 100644
  46. --- a/src/panel/applets/workspaces/WindowIcon.vala
  47. +++ b/src/panel/applets/workspaces/WindowIcon.vala
  48. @@ -72,7 +72,7 @@ namespace Workspaces {
  49. }
  50. public void on_drag_data_get(Gtk.Widget widget, Gdk.DragContext context, Gtk.SelectionData selection_data, uint target_type, uint time) {
  51. - ulong window_xid = (ulong)window.get_id();
  52. + ulong window_xid = (ulong)window.x11_get_xid();
  53. uchar[] buf;
  54. convert_ulong_to_bytes(window_xid, out buf);
  55. selection_data.set(
  56. diff --git a/src/panel/applets/workspaces/WorkspaceItem.vala b/src/panel/applets/workspaces/WorkspaceItem.vala
  57. index eccab8e70..ef76ee904 100644
  58. --- a/src/panel/applets/workspaces/WorkspaceItem.vala
  59. +++ b/src/panel/applets/workspaces/WorkspaceItem.vala
  60. @@ -179,7 +179,7 @@ namespace Workspaces {
  61. if (data != null) {
  62. try {
  63. foreach (libxfce4windowing.Window window in WorkspacesApplet.xfce_screen.get_windows()) {
  64. - if (window.get_id() == *data) {
  65. + if (window.x11_get_xid() == *data) {
  66. window.move_to_workspace(this.workspace);
  67. dnd_success = true;
  68. break;
  69. diff --git a/src/panel/applets/workspaces/WorkspacesApplet.vala b/src/panel/applets/workspaces/WorkspacesApplet.vala
  70. index 5d3435ac4..237bacd2e 100644
  71. --- a/src/panel/applets/workspaces/WorkspacesApplet.vala
  72. +++ b/src/panel/applets/workspaces/WorkspacesApplet.vala
  73. @@ -278,8 +278,8 @@ namespace Workspaces {
  74. }
  75. private void connect_signals() {
  76. - connections += workspace_group.workspace_created.connect(workspace_added);
  77. - connections += workspace_group.workspace_destroyed.connect(workspace_removed);
  78. + connections += workspace_group.workspace_added.connect(workspace_added);
  79. + connections += workspace_group.workspace_removed.connect(workspace_removed);
  80. connections += workspace_group.active_workspace_changed.connect(set_current_workspace);
  81. connections += xfce_screen.active_window_changed.connect(update_workspaces);
  82. connections += xfce_screen.window_opened.connect(window_opened);
  83. @@ -403,7 +403,7 @@ namespace Workspaces {
  84. libxfce4windowing.Window? window = null;
  85. foreach (libxfce4windowing.Window win in xfce_screen.get_windows()) {
  86. - if (win.get_id() == *data) {
  87. + if (win.x11_get_xid() == *data) {
  88. window = win;
  89. break;
  90. }
  91. diff --git a/vapi/README.md b/vapi/README.md
  92. index 6bd29f17d..857655b35 100644
  93. --- a/vapi/README.md
  94. +++ b/vapi/README.md
  95. @@ -1,17 +1,36 @@
  96. -Refreshing vapis
  97. ---------------
  98. +## Refreshing vapis
  99. +
  100. +### Polkit
  101. To refresh the Polkit vapi files:
  102. - vapigen --library polkit-gobject-1 /usr/share/gir-1.0/Polkit-1.0.gir --pkg gio-unix-2.0
  103. - vapigen --library polkit-agent-1 /usr/share/gir-1.0/PolkitAgent-1.0.gir --pkg gio-unix-2.0 --pkg polkit-gobject-1 --girdir=. --vapidir=.
  104. +```bash
  105. +vapigen --library polkit-gobject-1 /usr/share/gir-1.0/Polkit-1.0.gir --pkg gio-unix-2.0
  106. +vapigen --library polkit-agent-1 /usr/share/gir-1.0/PolkitAgent-1.0.gir --pkg gio-unix-2.0 --pkg polkit-gobject-1 --girdir=. --vapidir=.
  107. +```
  108. +
  109. +Then have fun un-mangling it to support vala async syntax.
  110. +
  111. +### Libxfce4windowing
  112. -Then have fun un-mangling it to support vala async syntax
  113. +To generate the libxfce4windowing vapi files:
  114. +
  115. +```bash
  116. +vapigen --library libxfce4windowing-0 /usr/share/gir-1.0/Libxfce4windowing-0-0.gir --metadatadir .
  117. +```
  118. +
  119. +### UPower
  120. To generate the UPower vapi files:
  121. - vapigen --library upower-glib /usr/share/gir-1.0/UpowerGlib-1.0.gir --metadatadir . --pkg gio-unix-2.0 UPowerGlib-1.0-custom.vala
  122. +```bash
  123. +vapigen --library upower-glib /usr/share/gir-1.0/UpowerGlib-1.0.gir --metadatadir . --pkg gio-unix-2.0 UPowerGlib-1.0-custom.vala
  124. +```
  125. +
  126. +### Mutter
  127. For mutter (and shipped cogl and clutter), once you defined the relative `*.deps`, `*.metadata` and `*-custom.vala` files, you can run:
  128. - ./vapi/generate-mutter-vapi.sh <mutter-version>
  129. +```bash
  130. +./vapi/generate-mutter-vapi.sh <mutter-version>
  131. +```
  132. diff --git a/vapi/libxfce4windowing-0.deps b/vapi/libxfce4windowing-0.deps
  133. index 319bc395a..bfc6c0973 100644
  134. --- a/vapi/libxfce4windowing-0.deps
  135. +++ b/vapi/libxfce4windowing-0.deps
  136. @@ -1,3 +1,4 @@
  137. gdk-3.0
  138. glib-2.0
  139. +gtk+-3.0
  140. libwnck-3.0
  141. diff --git a/vapi/libxfce4windowing-0.vapi b/vapi/libxfce4windowing-0.vapi
  142. index ed3a282b2..50da752bc 100644
  143. --- a/vapi/libxfce4windowing-0.vapi
  144. +++ b/vapi/libxfce4windowing-0.vapi
  145. @@ -6,13 +6,14 @@ namespace libxfce4windowing {
  146. public abstract class Application : GLib.Object {
  147. [CCode (has_construct_function = false)]
  148. protected Application ();
  149. + [CCode (cname = "xfw_application_get_class_id")]
  150. + [Version (since = "4.19.3")]
  151. + public unowned string get_class_id ();
  152. [CCode (cname = "xfw_application_get_gicon")]
  153. [Version (since = "4.19.1")]
  154. public unowned GLib.Icon get_gicon ();
  155. [CCode (cname = "xfw_application_get_icon")]
  156. public unowned Gdk.Pixbuf? get_icon (int size, int scale);
  157. - [CCode (cname = "xfw_application_get_id")]
  158. - public uint64 get_id ();
  159. [CCode (cname = "xfw_application_get_instance")]
  160. public unowned libxfce4windowing.ApplicationInstance? get_instance (libxfce4windowing.Window window);
  161. [CCode (cname = "xfw_application_get_instances")]
  162. @@ -25,9 +26,10 @@ namespace libxfce4windowing {
  163. [Version (since = "4.19.1")]
  164. public bool icon_is_fallback ();
  165. [NoAccessorMethod]
  166. - public GLib.Icon gicon { owned get; }
  167. + [Version (since = "4.19.3")]
  168. + public string class_id { owned get; }
  169. [NoAccessorMethod]
  170. - public uint64 id { get; }
  171. + public GLib.Icon gicon { owned get; }
  172. [NoAccessorMethod]
  173. public void* instances { get; }
  174. [NoAccessorMethod]
  175. @@ -87,6 +89,9 @@ namespace libxfce4windowing {
  176. public unowned libxfce4windowing.Application get_application ();
  177. [CCode (cname = "xfw_window_get_capabilities")]
  178. public libxfce4windowing.WindowCapabilities get_capabilities ();
  179. + [CCode (array_length = false, array_null_terminated = true, cname = "xfw_window_get_class_ids")]
  180. + [Version (since = "4.19.3")]
  181. + public unowned string[] get_class_ids ();
  182. [CCode (cname = "xfw_window_get_geometry")]
  183. public unowned Gdk.Rectangle? get_geometry ();
  184. [CCode (cname = "xfw_window_get_gicon")]
  185. @@ -94,8 +99,6 @@ namespace libxfce4windowing {
  186. public unowned GLib.Icon get_gicon ();
  187. [CCode (cname = "xfw_window_get_icon")]
  188. public unowned Gdk.Pixbuf? get_icon (int size, int scale);
  189. - [CCode (cname = "xfw_window_get_id")]
  190. - public uint64 get_id ();
  191. [CCode (cname = "xfw_window_get_monitors")]
  192. public unowned GLib.List<Gdk.Monitor>? get_monitors ();
  193. [CCode (cname = "xfw_window_get_name")]
  194. @@ -165,14 +168,19 @@ namespace libxfce4windowing {
  195. public bool start_move () throws GLib.Error;
  196. [CCode (cname = "xfw_window_start_resize")]
  197. public bool start_resize () throws GLib.Error;
  198. + [CCode (cname = "xfw_window_x11_get_xid")]
  199. + [Version (since = "4.19.3")]
  200. + public X.Window x11_get_xid ();
  201. [NoAccessorMethod]
  202. public libxfce4windowing.Application application { owned get; }
  203. [NoAccessorMethod]
  204. public libxfce4windowing.WindowCapabilities capabilities { get; }
  205. + [CCode (array_length = false, array_null_terminated = true)]
  206. [NoAccessorMethod]
  207. - public GLib.Icon gicon { owned get; }
  208. + [Version (since = "4.19.3")]
  209. + public string[] class_ids { owned get; }
  210. [NoAccessorMethod]
  211. - public uint64 id { get; }
  212. + public GLib.Icon gicon { owned get; }
  213. [NoAccessorMethod]
  214. public void* monitors { get; }
  215. [NoAccessorMethod]
  216. @@ -186,6 +194,8 @@ namespace libxfce4windowing {
  217. [NoAccessorMethod]
  218. public libxfce4windowing.Workspace workspace { owned get; }
  219. public signal void capabilities_changed (libxfce4windowing.WindowCapabilities changed_mask, libxfce4windowing.WindowCapabilities new_state);
  220. + [Version (since = "4.19.3")]
  221. + public signal void class_changed ();
  222. public signal void closed ();
  223. public signal void geometry_changed ();
  224. public signal void icon_changed ();
  225. @@ -313,6 +323,8 @@ namespace libxfce4windowing {
  226. public interface Workspace : GLib.Object {
  227. [CCode (cname = "xfw_workspace_activate")]
  228. public bool activate () throws GLib.Error;
  229. + [CCode (cname = "xfw_workspace_assign_to_workspace_group")]
  230. + public bool assign_to_workspace_group (libxfce4windowing.WorkspaceGroup group) throws GLib.Error;
  231. [CCode (cname = "xfw_workspace_get_capabilities")]
  232. public libxfce4windowing.WorkspaceCapabilities get_capabilities ();
  233. [CCode (cname = "xfw_workspace_get_geometry")]
  234. @@ -332,13 +344,13 @@ namespace libxfce4windowing {
  235. [CCode (cname = "xfw_workspace_get_state")]
  236. public libxfce4windowing.WorkspaceState get_state ();
  237. [CCode (cname = "xfw_workspace_get_workspace_group")]
  238. - public unowned libxfce4windowing.WorkspaceGroup get_workspace_group ();
  239. + public unowned libxfce4windowing.WorkspaceGroup? get_workspace_group ();
  240. [CCode (cname = "xfw_workspace_remove")]
  241. public bool remove () throws GLib.Error;
  242. [NoAccessorMethod]
  243. public abstract libxfce4windowing.WorkspaceCapabilities capabilities { get; set construct; }
  244. [NoAccessorMethod]
  245. - public abstract libxfce4windowing.WorkspaceGroup group { owned get; construct; }
  246. + public abstract libxfce4windowing.WorkspaceGroup group { owned get; }
  247. [NoAccessorMethod]
  248. public abstract string id { owned get; }
  249. [NoAccessorMethod]
  250. @@ -348,6 +360,7 @@ namespace libxfce4windowing {
  251. [NoAccessorMethod]
  252. public abstract libxfce4windowing.WorkspaceState state { get; set construct; }
  253. public signal void capabilities_changed (libxfce4windowing.WorkspaceCapabilities changed_mask, libxfce4windowing.WorkspaceCapabilities new_capabilities);
  254. + public signal void group_changed (libxfce4windowing.WorkspaceGroup previous_group);
  255. public signal void name_changed ();
  256. public signal void state_changed (libxfce4windowing.WorkspaceState changed_mask, libxfce4windowing.WorkspaceState new_state);
  257. }
  258. @@ -383,20 +396,32 @@ namespace libxfce4windowing {
  259. public abstract void* workspaces { get; }
  260. public signal void active_workspace_changed (libxfce4windowing.Workspace? previously_active_workspace);
  261. public signal void capabilities_changed (libxfce4windowing.WorkspaceGroupCapabilities changed_mask, libxfce4windowing.WorkspaceGroupCapabilities new_capabilities);
  262. + public signal void monitor_added (Gdk.Monitor monitor);
  263. + public signal void monitor_removed (Gdk.Monitor monitor);
  264. public signal void monitors_changed ();
  265. public signal void viewports_changed ();
  266. - public signal void workspace_created (libxfce4windowing.Workspace workspace);
  267. - public signal void workspace_destroyed (libxfce4windowing.Workspace workspace);
  268. + public signal void workspace_added (libxfce4windowing.Workspace workspace);
  269. + public signal void workspace_removed (libxfce4windowing.Workspace workspace);
  270. }
  271. [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceManager", type_id = "xfw_workspace_manager_get_type ()")]
  272. public interface WorkspaceManager : GLib.Object {
  273. [CCode (cname = "xfw_workspace_manager_list_workspace_groups")]
  274. public unowned GLib.List<libxfce4windowing.WorkspaceGroup>? list_workspace_groups ();
  275. + [CCode (cname = "xfw_workspace_manager_list_workspaces")]
  276. + public unowned GLib.List<libxfce4windowing.Workspace>? list_workspaces ();
  277. [NoAccessorMethod]
  278. public abstract Gdk.Screen screen { owned get; construct; }
  279. + public signal void workspace_created (libxfce4windowing.Workspace workspace);
  280. + public signal void workspace_destroyed (libxfce4windowing.Workspace workspace);
  281. public signal void workspace_group_created (libxfce4windowing.WorkspaceGroup group);
  282. public signal void workspace_group_destroyed (libxfce4windowing.WorkspaceGroup group);
  283. }
  284. + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwClientType", cprefix = "XFW_CLIENT_TYPE_", has_type_id = false)]
  285. + [Version (since = "4.19.3")]
  286. + public enum ClientType {
  287. + APPLICATION,
  288. + PAGER
  289. + }
  290. [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwDirection", cprefix = "XFW_DIRECTION_", type_id = "xfw_direction_get_type ()")]
  291. public enum Direction {
  292. UP,
  293. @@ -507,6 +532,9 @@ namespace libxfce4windowing {
  294. [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_screen_get_default")]
  295. [Version (replacement = "Screen.get_default")]
  296. public static libxfce4windowing.Screen screen_get_default ();
  297. + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_set_client_type")]
  298. + [Version (since = "4.19.3")]
  299. + public static void set_client_type (libxfce4windowing.ClientType client_type);
  300. [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_windowing_get")]
  301. public static libxfce4windowing.Windowing windowing_get ();
  302. }