-
Notifications
You must be signed in to change notification settings - Fork 41
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
Feature 14 #36
Feature 14 #36
Conversation
This commit introduces compatibility with the original unclutter project by allowing both all of its command-line parameters as well as the single dash syntax for parameters. fixes Airblader#14
This commit introduced proper support for specifying the X display to use. relates to Airblader#14
Forgot to add that the old unclutter works with window managers that create a virtual root (e.g. tvtwm, swm) but the xfixes version doesn't., My PR doesn't address that, which may be needed for full compatibility and the two people that still use tvtwm:-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, many thanks for the PR. I have a few comments, mostly just small things. I'd also wanna give this a go locally, but in the meantime we can address these already.
man/unclutter-xfixes.man
Outdated
See *--exclude-root*. | ||
|
||
*--onescreen*:: | ||
This argument is ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in new commit
man/unclutter-xfixes.man
Outdated
This argument is ignored. | ||
|
||
*--root*:: | ||
This argument is ignored as this is the default behavior in unclutter-xfixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated, though we should keep the information that it's the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in new commit.
man/unclutter-xfixes.man
Outdated
This argument is ignored. | ||
|
||
*--not*:: | ||
This argument is ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated (and properly described)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in new commit.
include/globals.h
Outdated
@@ -9,3 +9,10 @@ extern Display *display; | |||
extern int xi_ext_opcode; | |||
|
|||
extern Config config; | |||
|
|||
extern Matches *matches; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this belong into the config
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to config
src/unclutter.c
Outdated
if (roots == NULL) | ||
bail("Failed to allocate root windows."); | ||
for(screen = 0; screen < num_screens; screen++) | ||
roots[screen] = XRootWindow(display, screen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting here seems inconsistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where. Tweaked it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that this is only intended by two spaces rather than four.
src/event.c
Outdated
return false; | ||
} | ||
|
||
static Window last_avoided = None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move this into the global.h where all the global stuff is stored. At the very least it should be at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the top of the file. This is not a global. I would actually move it as a static inside the is_on_ignored_list function, the only place where it is used. Same for last_cursor_pos, which could be moved inside x_check_cb, unwrapped as last_cursor_pos_x and last_cursor_pos_y, which would get rid of the need for the coordinates_t type.
src/event.c
Outdated
last_avoided = win; | ||
return true; | ||
} | ||
} while (XQueryPointer(display, win_in, &win_dummy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least the XQueryPointer
call should be on a single line for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/unclutter.c
Outdated
} else if (OPT_NAME_IS("debug")) { | ||
config.debug = true; | ||
break; | ||
} else if (OPT_NAME_IS("keystroke") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these can all go on a single line
src/unclutter.c
Outdated
bail("Failed to allocate space for matches"); | ||
for (c = 0; optind < argc ; c++, optind++) { | ||
char *name = argv[optind]; | ||
matches[c].name = name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an extra space between =
and name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Pushed almost all requested changes to my feature-14 branch, should be reflected in the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one last formatting thing (I've clarified it) and then could you please also squash the commits together? Thank you!
man/unclutter-xfixes.man
Outdated
|
||
*--not*:: | ||
This argument will result in all arguments that aren't options or option arguments, to be collected | ||
into a list that specifies windows where the cursor shall not be removed. These will be the windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: There's an extra space here before "These"
man/unclutter-xfixes.man
Outdated
This argument will result in all arguments that aren't options or option arguments, to be collected | ||
into a list that specifies windows where the cursor shall not be removed. These will be the windows | ||
where an element of the list matches, in a case insensitive comparison, the starting characters of | ||
either the WM_NAME, or the name or class of the WM_CLASS, properties of the window. (Note that this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Another extra space
src/unclutter.c
Outdated
if (roots == NULL) | ||
bail("Failed to allocate root windows."); | ||
for(screen = 0; screen < num_screens; screen++) | ||
roots[screen] = XRootWindow(display, screen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that this is only intended by two spaces rather than four.
536bbd8
to
57fea4d
Compare
Removed the extra spaces in the man page. |
Implements old unclutter root, onescreen and not options.
6956ff7
to
8ef5a7c
Compare
found some more indentation problems in cursor.c, forced push/squashed a new commit |
Thanks! I'm a little short on time right now but just wanted to let you know that it's on my list and I'll get to it! |
Thanks! Now I need to decide whether I'll keep building this from your github repo or try to push this into Fedora, which means volunteering to be a maintainer ... |
Volunteer to be a maintainer! ;-) |
using feature-14 branch this adds multi screen capability and old unclutter onescreen and not flags (albeit doing case insensitive match against window's name or class name or class resource