summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2022-08-23 18:24:35 +1200
committerBossCode45 <human.cyborg42@gmail.com>2022-08-23 18:24:35 +1200
commit0c9396c9f2e14c61f6082916df81e4251fa1d3ec (patch)
treed75c77b16c52140a16436225449d68bc49db5189 /main.cpp
parent546f7d2518a86d43c9591e1e056cdf0f98c5f40a (diff)
downloadYATwm-0c9396c9f2e14c61f6082916df81e4251fa1d3ec.tar.gz
YATwm-0c9396c9f2e14c61f6082916df81e4251fa1d3ec.zip
Fixed bug with negative width due to another bug in gaps calculation -_-
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 4633f5d..1efabe5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -9,6 +9,8 @@
#include <algorithm>
#include "structs.h"
+#include "util.h"
+
#include "config.h"
using std::cout;
@@ -91,7 +93,6 @@ void kill(const KeyArg arg)
void keyPress(XKeyEvent e)
{
if(e.same_screen!=1) return;
- //TODO: Make this into a for loop
KeySym keysym = XLookupKeysym(&e, 1);
for(int i = 0; i < sizeof(keyBinds)/sizeof(keyBinds[0]); i++)
{
@@ -226,6 +227,9 @@ void destroyNotify(XDestroyWindowEvent e)
static int OnXError(Display* display, XErrorEvent* e)
{
cout << "XError " << e->type << ":\n";
+ char buffer_return[100];
+ XGetErrorText(dpy, e->type, buffer_return, sizeof(buffer_return));
+ printf("\t%s\n", buffer_return);
return 0;
}
@@ -249,8 +253,8 @@ void tile(int frameID, int x, int y, int w, int h)
i++;
if(i==subFrameIDs.size())
{
- wW = (dir==horizontal) ? w - wX + outerGaps : w;
- wH = (dir==vertical) ? h - wY + outerGaps : h;
+ wW = (dir==horizontal) ? w - (wX - x) : w;
+ wH = (dir==vertical) ? h - (wY - y) : h;
}
if(!f.isClient)
{
@@ -262,7 +266,7 @@ void tile(int frameID, int x, int y, int w, int h)
wW -= gaps * 2;
wH -= gaps * 2;
Client c = clients.find(f.cID)->second;
- printf("Arranging client with frame ID %i, client ID %i:\n\tx: %i, y: %i, w: %i, h: %i\n", fID, c.ID, wX, wY, wW, wH);
+ //printf("Arranging client with frame ID %i, client ID %i:\n\tx: %i, y: %i, w: %i, h: %i\n", fID, c.ID, wX, wY, wW, wH);
XMoveWindow(dpy, c.w,
wX, wY);
XResizeWindow(dpy, c.w,
@@ -332,7 +336,7 @@ int main(int argc, char** argv)
XSetInputFocus(dpy, e.xcrossing.window, RevertToNone, CurrentTime);
break;
default:
- //cout << "Unhandled event, code: " << e.type << "!\n";
+ //cout << "Unhandled event, code: " << evNames[e.type] << "!\n";
break;
}
}