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

Added "active_window" helper tool (jsc#PM-1895, jsc#SLE-16263) #23

Merged
merged 3 commits into from
Feb 5, 2021

Conversation

lslezak
Copy link
Member

@lslezak lslezak commented Feb 5, 2021

  • Related to The Installer Console (SLE-16263, SLE-16358) yast-installation#905
  • For the GUI console we need to somehow automatically switch between the console window and the YaST installer window.
  • Originally I wanted to use the xdotool but that is a generic tool with lots of features and is quite big. It would also add a new dependency. So I wrote a very small single purpose tool.
  • Do not ask me for implementation details, I used Google and StackOverflow a lot. 😃 See the links in the source code.

Testing

At first just a simple test, get the WID of the active YaST window, then activate it from the xterm:
active_window_test

Integration into the YaST console, when the configure_network command is finished (the network configuration module is done) then the console (xterm) window is activated and moved to the foreground. Without this tool the user would see "frozen" YaST and need to manually switch via Alt-Tab:
installer_console_gui

Copy link
Member

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

Thanks!

IIUC activating a nonsensical window id is not an error we can detect, because the X server will not return an error, right?

src/tools/active_window.c Outdated Show resolved Hide resolved
Co-authored-by: Martin Vidner <mvidner@suse.cz>
@lslezak
Copy link
Member Author

lslezak commented Feb 5, 2021

Yes, activating a non-existing window is not detected. The error handling is a bit tricky as the request is just queued and it is processed later by the server.

Maybe you can check somehow for the result but as this tool is for a very specific purpose I'd keep it simple.

@lslezak lslezak merged commit a94807b into master Feb 5, 2021
@lslezak lslezak deleted the active_window branch February 5, 2021 12:08
@yast-bot
Copy link
Contributor

yast-bot commented Feb 5, 2021

✔️ Public Jenkins job #8 successfully finished
✔️ Created OBS submit request #869734

@yast-bot
Copy link
Contributor

yast-bot commented Feb 5, 2021

✔️ Internal Jenkins job #4 successfully finished
✔️ Created IBS submit request #235401

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.

3 participants