Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise virtual cursor over new windows as needed #3

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions night-vision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ int main(int argc, char* argv[]) {
}

int lastX = -1, lastY = -1; // Variables to track the last known mouse position
int minHeight = 0; // TODO: User-defined via dotfile settings

while (true) {
Window dummy;
Expand All @@ -55,6 +56,13 @@ int main(int argc, char* argv[]) {
XDrawLine(display, window, gc, 12 + offset, 4, 12 + offset, 20);
XDrawLine(display, window, gc, 4, 12 + offset, 20, 12 + offset);
}
//XRaiseWindow(display, window) // Expensive to call constantly
XWindowAttributes winAttrs;
if (XGetWindowAttributes(display, root, &winAttrs)) {
if (winAttrs.height >= minHeight) {
XRaiseWindow(display, window); // Conditionally raise the cursor window
}
}
XFlush(display);
}
}
Expand Down
Loading