summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-06-03 21:30:05 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-06-03 21:30:05 +1200
commite9cc5756dbb0a2d079a7b5e3438d79945f819df5 (patch)
tree3881cb6bed150ef11252ef04a5e11c05d5af05f8 /main.cpp
parent01bc6a33eb235cd10851e2c31b99e6840603ca7d (diff)
downloadYATwm-e9cc5756dbb0a2d079a7b5e3438d79945f819df5.tar.gz
YATwm-e9cc5756dbb0a2d079a7b5e3438d79945f819df5.zip
feat: Keybind updates
Re added the ability to swap super and mod as a config parameter (the ~swapmods~) command). Finally fixed keybinds sometimes not working because of numlock, bitwise & with the modifiers I actually care about.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/main.cpp b/main.cpp
index 034554c..e74634d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -51,7 +51,7 @@ Window& root = globals.root;
CommandsModule commandsModule;
Config cfg(commandsModule);
-KeybindsModule keybindsModule(commandsModule, globals);
+KeybindsModule keybindsModule(commandsModule, cfg, globals);
int sW, sH;
int bH;
@@ -527,6 +527,9 @@ const void reload(const CommandArg* argv)
{
detectScreens();
+ //Clear keybinds
+ keybindsModule.clearKeybinds();
+
//Load config again
vector<Err> cfgErr = cfg.reloadFile();
//Error check
@@ -964,31 +967,25 @@ int main(int argc, char** argv)
//Notifications
notify_init("YATwm");
- cout << 0 << endl;
//Error check config
handleConfigErrs(cfgErr);
- cout << 1 << endl;
screens = new ScreenInfo[1];
focusedWorkspaces = new int[1];
detectScreens();
- cout << 2 << endl;
int screenNum = DefaultScreen(dpy);
sW = DisplayWidth(dpy, screenNum);
sH = DisplayHeight(dpy, screenNum);
- cout << 3 << endl;
XSetErrorHandler(OnXError);
XSelectInput(dpy, root, SubstructureRedirectMask | SubstructureNotifyMask | KeyPressMask | EnterWindowMask);
- cout << 4 << endl;
XDefineCursor(dpy, root, XCreateFontCursor(dpy, XC_top_left_arrow));
//EWMH
initEWMH(&dpy, &root, cfg.workspaces.size(), cfg.workspaces);
setCurrentDesktop(1);
- cout << 5 << endl;
for(int i = 1; i < cfg.numWS + 1; i++)
{
vector<int> v;