Floating rules are now isolated between workspaces

This commit is contained in:
2025-06-11 11:48:31 +02:00
parent d9d2a74f02
commit b400cb539f
8 changed files with 176 additions and 16 deletions

View File

@@ -1,13 +1,17 @@
#ifndef FILE_SERVICES_H
#define FILE_SERVICES_H
#ifndef FILE_SERVICE_H
#define FILE_SERVICE_H
#include <string>
#include <vector>
class FileServices {
class FileService {
public:
static bool doesNonEmptyFileExist(std::string);
static void emptyFile(std::string);
static void createOrOverwriteFile(std::string, std::string);
static void appendToFile(std::string, std::string);
static void deleteNthLine(std::string, int);
static std::vector<std::string> readLines(std::string);
};
#endif

View File

@@ -4,13 +4,17 @@
#include <list>
#include "Workspace.h"
#include "Client.h"
#include "WindowRule.h"
class HyprlandService {
public:
static Workspace getCurrentWorkspace();
static std::list<Client> getClients();
static std::list<Client> getClientsOnActiveWorkspace();
static std::list<WindowRule> getWindowRules();
static std::optional<WindowRule> findConflictingRule(WindowRule);
static void setFloatingRule(bool);
static void removeRule(WindowRule);
static void setClientFloating(Client&);
static void setClientTiled(Client&);
static void toggleClientFloating(Client&);

View File

@@ -9,6 +9,6 @@
#define ECHO_PATH "/usr/bin/echo"
#define CAT_PATH "/usr/bin/cat"
#define FLOATING_RULE "windowrule = float,class:.*"
#define FLOATING_RULE "windowrule = float, onworkspace:"
#endif

20
include/WindowRule.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef WINDOW_RULE_H
#define WINDOW_RULE_H
#include <string>
class WindowRule {
public:
//true -> tiling mode
//false -> floating mode
bool tile;
//Which workspace to apply to
int workspaceID;
std::string toString();
static WindowRule parse(std::string);
};
#endif