Skip to content

Conversation

jonahgraham
Copy link
Contributor

@jonahgraham jonahgraham commented Oct 3, 2025

The value of org.eclipse.swt.internal.gdk.backend is not set until a display is created at least once since this value is assigned in the Display constructor.

To be able to detect if Display has been created, set "org.eclipse.swt.internal.gdk.backend" on wayland too.

A similar problem exists for org.eclipse.swt.internal.gtk.version in relation to OS.

This is a fix for a regression caused by moving the setting of org.eclipse.swt.internal.gdk.backend from OS to Display in 5d67ce6. That commit fixed an unrelated bug, but sometimes bad initialization of isX11 is an unintended side effect causing tests to be skipped or run in unexpected ways since isX11 was not correct.

See for example #2592 for a test that was silently being skipped and had bitrotten as a result.

@jonahgraham
Copy link
Contributor Author

I think some of the tests that were supposed to have been guarded by isX11 may have bitrotten, for example test_activateEventSend fails on my machine now that I have fixed the isX11 test.

Copy link
Contributor

github-actions bot commented Oct 3, 2025

Test Results

  118 files  ±0    118 suites  ±0   10m 41s ⏱️ - 2m 21s
4 583 tests ±0  4 566 ✅ +1  17 💤  - 1  0 ❌ ±0 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit 56a8fb8. ± Comparison against base commit 0865865.

♻️ This comment has been updated with latest results.

@jonahgraham
Copy link
Contributor Author

for example test_activateEventSend fails on my machine now that I have fixed the isX11 test.

It also fails on the build machine. A fix for the unstable test is in #2592

jonahgraham added a commit to jonahgraham/eclipse.platform.swt that referenced this pull request Oct 4, 2025
test_activateEventSend hasn't run in a while due to a
test condition error (see eclipse-platform#2591). Therefore
we are going to disable this test that is a feature
only on GTK3/x11
@jonahgraham
Copy link
Contributor Author

I'm deferring resolving this until #2593 is complete as this change makes the tests look unstable, but it really is just exposing some long non-running tests.

jonahgraham added a commit to jonahgraham/eclipse.platform.swt that referenced this pull request Oct 4, 2025
test_activateEventSend hasn't run in a while due to a
test condition error (see eclipse-platform#2591). Therefore
we are going to disable this test that is a feature
only on GTK3/x11
jonahgraham added a commit to jonahgraham/eclipse.platform.swt that referenced this pull request Oct 7, 2025
It may take some event cycles before the parent shell that
is getting focus/activation back gets the notification.
Therefore wait until the Activate listener is called

This test had bitrotten due to order of operation issues,
see eclipse-platform#2591
for details on that.

This test was a regression test for https://bugs.eclipse.org/436841,
but only tested 1 of the 4 events. I added to the test all the events.
The test was also written before GTK4 (???) and was disabled on
non-x11. The test is now enabled on x11.
jonahgraham added a commit to jonahgraham/eclipse.platform.swt that referenced this pull request Oct 7, 2025
It may take some event cycles before the parent shell that
is getting focus/activation back gets the notification.
Therefore wait until the Activate listener is called

This test had bitrotten due to order of operation issues,
see eclipse-platform#2591
for details on that.

This test was a regression test for https://bugs.eclipse.org/436841,
but only tested 1 of the 4 events. I added to the test all the events.
The test was also written before GTK4 (???) and was disabled on
non-x11. The test is now enabled on x11.
jonahgraham added a commit that referenced this pull request Oct 7, 2025
It may take some event cycles before the parent shell that
is getting focus/activation back gets the notification.
Therefore wait until the Activate listener is called

This test had bitrotten due to order of operation issues,
see #2591
for details on that.

This test was a regression test for https://bugs.eclipse.org/436841,
but only tested 1 of the 4 events. I added to the test all the events.
The test was also written before GTK4 (???) and was disabled on
non-x11. The test is now enabled on x11.
@jonahgraham jonahgraham force-pushed the x11 branch 2 times, most recently from 149d92c to f9b8b8c Compare October 7, 2025 15:40
@jonahgraham jonahgraham marked this pull request as ready for review October 7, 2025 15:40
@jonahgraham jonahgraham marked this pull request as draft October 7, 2025 15:52
@jonahgraham jonahgraham changed the title Avoid reading org.eclipse.swt.internal.gdk.backend too early Avoid reading org.eclipse.swt.* properties too early Oct 7, 2025
Copy link
Contributor Author

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

I updated OP comment to reflect slight increase of scope #2591 (comment)

The value of org.eclipse.swt.internal.gdk.backend is not set until
a display is created at least once since this value is assigned in
the Display constructor.

To be able to detect if Display has been created, set
"org.eclipse.swt.internal.gdk.backend" on wayland too.

A similar problem exists for org.eclipse.swt.internal.gtk.version
in relation to OS.

This is a fix for a regression caused by moving the setting of
org.eclipse.swt.internal.gdk.backend from OS to Display in
5d67ce6. That commit fixed
an unrelated bug, but sometimes bad initialization of isX11 is an
unintended side effect causing tests to be skipped or run in
unexpected ways since isX11 was not correct.

See for example eclipse-platform#2592
for a test that was silently being skipped and had bitrotten as
a result.
@jonahgraham jonahgraham marked this pull request as ready for review October 7, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants