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

Feature 14 #36

Merged
merged 3 commits into from
Dec 9, 2018
Merged

Feature 14 #36

merged 3 commits into from
Dec 9, 2018

Conversation

ileGITimo
Copy link
Contributor

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

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
@ileGITimo
Copy link
Contributor Author

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:-)

Copy link
Owner

@Airblader Airblader left a 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.

See *--exclude-root*.

*--onescreen*::
This argument is ignored.
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in new commit

This argument is ignored.

*--root*::
This argument is ignored as this is the default behavior in unclutter-xfixes.
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in new commit.

This argument is ignored.

*--not*::
This argument is ignored.
Copy link
Owner

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in new commit.

@@ -9,3 +9,10 @@ extern Display *display;
extern int xi_ext_opcode;

extern Config config;

extern Matches *matches;
Copy link
Owner

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?

Copy link
Contributor Author

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);
Copy link
Owner

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

Copy link
Contributor Author

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.

Copy link
Owner

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;
Copy link
Owner

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.

Copy link
Contributor Author

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,
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

src/event.c Show resolved Hide resolved
src/unclutter.c Outdated
} else if (OPT_NAME_IS("debug")) {
config.debug = true;
break;
} else if (OPT_NAME_IS("keystroke") ||
Copy link
Owner

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;
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@ileGITimo
Copy link
Contributor Author

Pushed almost all requested changes to my feature-14 branch, should be reflected in the pull request.
Sorry, not github literate about all this comment stuff.
Let me know if you still like more changes.

Copy link
Owner

@Airblader Airblader left a 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!


*--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
Copy link
Owner

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"

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
Copy link
Owner

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);
Copy link
Owner

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 Show resolved Hide resolved
@ileGITimo
Copy link
Contributor Author

Removed the extra spaces in the man page.
Reformatted one function with 4 space indentation.
(Hopefully) squashed all commits into one.

Implements old unclutter root, onescreen and not options.
@ileGITimo
Copy link
Contributor Author

found some more indentation problems in cursor.c, forced push/squashed a new commit

@Airblader
Copy link
Owner

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!

@Airblader Airblader merged commit 73f1d87 into Airblader:master Dec 9, 2018
@ileGITimo
Copy link
Contributor Author

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 ...

@Airblader
Copy link
Owner

Volunteer to be a maintainer! ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants