Compare commits

...

2 Commits

Author SHA1 Message Date
maxbyte9p
e1c0cdd1a2 Fixed left and right shift scan codes 2024-05-22 13:51:57 -04:00
maxbyte9p
7b149594fe Make window start as a floating window because fuck i3 2024-05-22 13:39:22 -04:00
2 changed files with 12 additions and 3 deletions

View File

@@ -117,8 +117,8 @@ namespace Keys {
static const Key LAlt {'\\', X11Scancode::LEFT_ALT, WindowsScancode::ALT};
static const Key RAlt {'\\', X11Scancode::RIGHT_ALT, WindowsScancode::ALT};
static const Key LShift {'\\', X11Scancode::LEFT, WindowsScancode::LEFT_ARROW};
static const Key RShift {'\\', X11Scancode::RIGHT, WindowsScancode::RIGHT_ARROW};
static const Key LShift {'\\', X11Scancode::LEFT_SHIFT, WindowsScancode::LEFT_SHIFT};
static const Key RShift {'\\', X11Scancode::RIGHT_SHIFT, WindowsScancode::RIGHT_SHIFT};
// TODO: Get the right character codes for these
static const Key UpArrow {'\u000a', X11Scancode::UP, WindowsScancode::UP_ARROW};

View File

@@ -26,6 +26,9 @@ XVisualInfo* visual;
XSetWindowAttributes xSetWindowAttributes;
XWindowAttributes windowAttributes;
Atom wmDeleteWindow;
// Make it start as floating because fuck tiling WMs
Atom windowTypeAtom;
Atom windowTypeUtilityAtom;
XSizeHints hints;
GLXContext glContext;
@@ -351,6 +354,12 @@ namespace ReWindow {
window = XCreateWindow(display, RootWindow(display, defaultScreen), 0, 0, width, height, 0, visual->depth,
InputOutput, visual->visual, CWBackPixel | CWColormap | CWBorderPixel | NoEventMask,
&xSetWindowAttributes);
// Set window to floating because fucking tiling WMs
windowTypeAtom = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
windowTypeUtilityAtom = XInternAtom(display, "_NET_WM_WINDOW_TYPE_UTILITY", False);
XChangeProperty(display, window, windowTypeAtom, XA_ATOM, 32, PropModeReplace,
(unsigned char *)&windowTypeUtilityAtom, 1);
//
XSelectInput(display, window,
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
PointerMotionMask |
@@ -399,4 +408,4 @@ namespace ReWindow {
}
// TODO: Implement ControllerButton map
}
}