diff --git a/.xkb/symbols/mac_gui b/.xkb/symbols/mac_gui index 989ae68..49e73d8 100644 --- a/.xkb/symbols/mac_gui +++ b/.xkb/symbols/mac_gui @@ -33,6 +33,15 @@ xkb_symbols "swapescape" { key { [ Escape ] }; key { [ Caps_Lock ] }; }; +hidden partial modifier_keys +xkb_symbols "caps_shiftlock" { + replace key { [ Shift_Lock ] }; + modifier_map Shift { Shift_Lock }; +}; +hidden partial modifier_keys +xkb_symbols "caps_none" { + key { [ VoidSymbol ] }; +}; default partial xkb_symbols "mac_levelssym" { // // Minimize window Cmd + H = Alt + F9 // // 2 caveats diff --git a/kintox11/binary/kintox11 b/kintox11/binary/kintox11 index a50c590..49950ee 100755 Binary files a/kintox11/binary/kintox11 and b/kintox11/binary/kintox11 differ diff --git a/kintox11/src/kintox11.c b/kintox11/src/kintox11.c index 7649bdf..cef0136 100644 --- a/kintox11/src/kintox11.c +++ b/kintox11/src/kintox11.c @@ -62,7 +62,7 @@ int XNextEventTimeout(Display *d, XEvent *e, double seconds, long long event_ts, long long int new_ts = timeInMilliseconds(); // Make sure window dragging or resizing is not occuring - if(!(e->type == 22 && (e->type == last_event) && timeInMilliseconds()-event_ts < 419)){ + if(!(e->type == ConfigureNotify && (e->type == last_event) && timeInMilliseconds()-event_ts < 419)){ *event_ts_ptr = new_ts; *last_event_ptr = e->type; break; @@ -192,7 +192,7 @@ Window get_focus_window(Display* d, int etype, char const *eventName, char const printf("\n get focus window\n"); } - if(!(etype == 17 || etype == 18)) { + if(!(etype == DestroyNotify || etype == UnmapNotify)) { XGetInputFocus(d, &w, &revert_to); // see man if(debug == true){ printf(" -%s: event: %d, window_id: %ld\n",current_app,etype,w); @@ -233,7 +233,7 @@ Window get_top_window(Display* d, Window start, int etype, char const *eventName // Checking for Destroy and Unmap Notify events here too // Sometimes they still get passed through and if so need // to be ignored or XQueryTree will cause a segmentation fault - while (parent != root && parent != 0 && !(etype == 17 || etype == 18)) { + while (parent != root && parent != 0 && !(etype == DestroyNotify || etype == UnmapNotify)) { w = parent; s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man @@ -638,7 +638,7 @@ int main(int argc, char *argv[]){ while (1) { XNextEvent(d, &e); // Make sure window dragging or resizing is not occuring - if(!(e.type == 22 && (e.type == last_event) && timeInMilliseconds()-event_ts < 300)){ + if(!(e.type == ConfigureNotify && (e.type == last_event) && timeInMilliseconds()-event_ts < 300)){ if(debug == true){ printf(" event: %s %d\n",eventNames[e.type-1],e.type); printf(" duration: %lldms\n",timeInMilliseconds()-event_ts); @@ -655,8 +655,9 @@ int main(int argc, char *argv[]){ // Reference http://www.rahul.net/kenton/xproto/xevents_errors.html // event type 17 - DestroyNotify // event type 18 - UnmapNotify + // event type 22 - ConfigureNotify // Dismiss the following events by initiating another XNextEvent - while(e.type == 17 || e.type == 18){ + while(e.type != ConfigureNotify){ XNextEvent(d, &e); } diff --git a/uninstall.sh b/uninstall.sh index 266eb11..e1424ca 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,9 +1,13 @@ #!/bin/bash -systemctl --user stop keyswap +systemctl --user stop keyswap 2>/dev/null systemctl --user disable keyswap +systemctl --user stop keyswap.timer 2>/dev/null +systemctl --user disable keyswap.timer +rm ~/.config/systemd/user/keyswap.service +rm ~/.config/systemd/user/keyswap.timer rm -rf ~/.config/autostart/kinto.desktop rm -rf ~/.config/kinto rm -rf ~/.xkb - -sed -i '/xkb/d' ~/.Xsession \ No newline at end of file +systemctl daemon-reload +sed -i '/xkb/d' ~/.Xsession 2>/dev/null \ No newline at end of file