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

Fix #247 (crash when X11WindowDriver failed to get window properties) #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elipsitz
Copy link

X11WindowDriver uses XGetWindowPropertyRef to get a reference
to the properties of the active window. If this fails, however,
the outer function findFocusedWindow does not return "NO" to
indicate failure, because the result of the inner block is
ignored. This change makes sure findFocusedWindow returns "NO" if the
inner block returns "NO".

Reproduce/test by using a GTK window, like sylpheed as suggested in the window, or this ginput/matplotlib Python script:

import matplotlib.pyplot as plt
plt.title("test ginput")
x = plt.ginput(n=0, timeout=-1)

Trying to use ShiftIt on the window still won't work, but ShiftIt will no longer crash.

Fixes #247 .

X11WindowDriver uses `XGetWindowPropertyRef` to get a reference
to the properties of the active window. If this fails, however,
the outer function findFocusedWindow does not return "NO" to
indicate failure, because the result of the inner block is
ignored.

This change makes sure findFocusedWindow returns "NO" if the
inner block returns "NO".
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.

1 participant