summaryrefslogtreecommitdiff
path: root/hyprland/src/workspace.vala
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-01 14:17:36 +0200
committerAylur <[email protected]>2024-09-01 14:17:36 +0200
commit3e3f045d650a839d21f7b649da7aa5c19bd2e38b (patch)
tree9a974eb0d38932d474940288c662bd1f01ea3088 /hyprland/src/workspace.vala
parent408faee16911ccfaa3e7dad69f9938fd4a696704 (diff)
monorepo structuring
Diffstat (limited to 'hyprland/src/workspace.vala')
-rw-r--r--hyprland/src/workspace.vala57
1 files changed, 0 insertions, 57 deletions
diff --git a/hyprland/src/workspace.vala b/hyprland/src/workspace.vala
deleted file mode 100644
index 075f86f..0000000
--- a/hyprland/src/workspace.vala
+++ /dev/null
@@ -1,57 +0,0 @@
-namespace AstalHyprland {
-public class Workspace : Object {
- public signal void removed ();
-
- public List<weak Client> _clients = new List<weak Client>();
-
- public int id { get; private set; }
- public string name { get; private set; }
- public Monitor monitor { get; private set; }
- public List<weak Client> clients { owned get { return _clients.copy(); } }
- public bool has_fullscreen { get; private set; }
- public Client last_client { get; private set; }
-
- public Workspace.dummy(int id, Monitor? monitor) {
- this.id = id;
- this.name = id.to_string();
- this.monitor = monitor;
- }
-
- internal List<weak Client> filter_clients() {
- var hyprland = Hyprland.get_default();
- var list = new List<weak Client>();
- foreach (var client in hyprland.clients) {
- if (client.workspace == this) {
- list.append(client);
- }
- }
-
- return list;
- }
-
- internal void sync(Json.Object obj) {
- var hyprland = Hyprland.get_default();
-
- id = (int)obj.get_int_member("id");
- name = obj.get_string_member("name");
- has_fullscreen = obj.get_boolean_member("hasfullscreen");
-
- monitor = hyprland.get_monitor((int)obj.get_int_member("monitorID"));
- last_client = hyprland.get_client(obj.get_string_member("lastwindow"));
-
- var list = filter_clients();
- if (_clients.length() != list.length()) {
- _clients = list.copy();
- notify_property("clients");
- }
- }
-
- public void focus() {
- Hyprland.get_default().dispatch("workspace", id.to_string());
- }
-
- public void move_to(Monitor m) {
- Hyprland.get_default().dispatch("moveworkspacetomonitor", id.to_string() + " " + m.id.to_string());
- }
-}
-}