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

Workaround lost windows focus in GNOME #15334

Closed
wants to merge 1 commit into from

Conversation

mloviska
Copy link
Contributor

@mloviska mloviska commented Aug 8, 2022

Bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1202103

Opening windows from desktop runner might open windows without a focus.
That causes typing failures in xterm for instance.

Bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1202103

Opening windows from desktop runner might open windows without a focus.
That causes typing failures in `xterm` for instance.
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files

@mloviska
Copy link
Contributor Author

mloviska commented Aug 8, 2022

This should work and I have scope it only for xterm as I am not aware of any other case that hit us. http://kepler.suse.cz/tests/18453#step/updates_packagekit_gpk/32

I will need to update the needles accordingly as well.

# workaround for lost focus in GNOME
# bsc#1202103 - [Build 20220803-2] GNOME: lost window focus
if ($program eq 'xterm') {
foreach my $property (@{$match->{needle}->{properties}}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it possible to use $match->has_property('workaround') here? I would need to serialize the object first?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't know that. At best we can avoid this. How about

            click_lastmatch() if match_has_tag('unfocussed');

As you can add multiple tags to needles. This way you also don't need the unusual handling of the assert_screen return value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that is another solution, adding new elements (xterm-unfocussed) into @target. I do not really have any preference over here, but it seems fine just to add a workaround property for GNOME's xterm needle.

Copy link
Member

Choose a reason for hiding this comment

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

Well, if you don't have a preference may I please ask you to implement my suggestion as that relies less on internals but only the stable API and should therefore be more reliable

@stale
Copy link

stale bot commented Nov 22, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If it's still needed, you can add labels WIP or notready to it

@stale stale bot added the stale Stale pull request, are to be deleted within 90 days label Nov 22, 2022
Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

See latest suggestions

@mloviska mloviska closed this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale pull request, are to be deleted within 90 days
Projects
None yet
2 participants