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(linux): Explicitly initialize GTK #9706

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

ermshiperete
Copy link
Contributor

@ermshiperete ermshiperete commented Oct 6, 2023

Usually this is done automatically. However, if e.g. no DISPLAY variable is set it'll fail. When we explicitly initialize GTK it still fails, but shows a more helpful warning instead of throwing a runtime error.

Fixes #9705.

User Testing

Preparations

Tests

TEST_WARNING: if DISPLAY is not set we should get a warning instead of a runtime error

  • in a terminal window, run unset DISPLAY
  • in the same terminal, start Keyman Configuration by typing km-config
  • Verify that instead of opening the Keyman Configuration window the terminal displays a warning similar to Gtk-WARNING **: 16:51:19.867: cannot open display:. There should be no lines containing the text RuntimeError.

Usually this is done automatically. However, if e.g. no `DISPLAY` variable
is set it'll fail. When we explicitly initialize GTK it still fails, but
shows a more helpful warning instead of throwing a runtime error.

Fixes #9705.
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Oct 6, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 6, 2023

User Test Results

Test specification and instructions

  • TEST_WARNING (PASSED): Retested as per eberhard's new instructions in Ubuntu Lunar Linux OS (VM) and here is my observation: 1. Tested this in Ubuntu on Xorg (X11) Lunar Linux OS. 2. Verified that instead of opening keyman configuration dialog it shows an error message on the terminal window. 3. Also, verified that it does not show 'Runtime error' in the terminal window. Seems to be working as expected. (notes)

Test Artifacts

@bharanidharanj
Copy link

Test Results

  • TEST_WARNING (FAILED): Tested with the attached PR build (keyman 17.0.187-alpha-local (package version 17.0.187-1~PR-9706-1427.1+lunar1) in Lunar 23.04 Linux OS and here is my observation: 1. Run the above mentioned commands in the terminal window. Noticed that it opens the Keyman Configuration window on the screen. 2. The expected result is not displayed on the terminal. Seems to be an issue.

@keymanapp-test-bot keymanapp-test-bot bot added user-test-failed and removed user-test-required User tests have not been completed labels Oct 9, 2023
@ermshiperete
Copy link
Contributor Author

ermshiperete commented Oct 9, 2023

@bharanidharanj I tried and it works for me on Lunar. Can you please try again? And if it fails again run dpkg -l keyman in the terminal. Also, run echo $DISPLAY and try to start Firefox (firefox in the terminal). Thanks!

@keymanapp-test-bot retest

@keymanapp-test-bot keymanapp-test-bot bot added user-test-required User tests have not been completed and removed user-test-failed labels Oct 9, 2023
@bharanidharanj
Copy link

bharanidharanj commented Oct 9, 2023

Test Results

  • TEST_WARNING (FAILED): Retested as per your suggestion in Lunar Linux OS and here is my observation: 1. I run the commands in the terminal window as per your instructions. 2. Still, I am seeing the Keyman Configuration window open after running the km-config command in the terminal window. Please, let me know If I missed anything in this test.

..Keyman Configuration window still opens

@keymanapp-test-bot keymanapp-test-bot bot added user-test-failed and removed user-test-required User tests have not been completed labels Oct 9, 2023
@ermshiperete
Copy link
Contributor Author

ok, so the problem is that DISPLAY is still set (echo $DISPLAY should output an empty line). Does DISPLAY= km-config give the desired results (i.e. DISPLAY= followed by km-config in the same line)?

@keymanapp-test-bot retest

@keymanapp-test-bot keymanapp-test-bot bot added user-test-required User tests have not been completed and removed user-test-failed labels Oct 9, 2023
@ermshiperete
Copy link
Contributor Author

Test failed because of incomplete test instructions. It can't be tested with Wayland but has to be tested with X11.

@bharanidharanj
Copy link

Test Results

  • TEST_WARNING (PASSED): Retested as per eberhard's new instructions in Ubuntu Lunar Linux OS (VM) and here is my observation: 1. Tested this in Ubuntu on Xorg (X11) Lunar Linux OS. 2. Verified that instead of opening keyman configuration dialog it shows an error message on the terminal window. 3. Also, verified that it does not show 'Runtime error' in the terminal window. Seems to be working as expected.

..Warning Message in Terminal Window

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Oct 10, 2023
@ermshiperete ermshiperete merged commit 1343829 into master Oct 10, 2023
3 checks passed
@ermshiperete ermshiperete deleted the fix/linux/gtkinit branch October 10, 2023 07:03
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.187-alpha

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

Successfully merging this pull request may close these issues.

bug(linux): Unhandled RuntimeError because of missing GTK initialization
4 participants