Skip to content

[GTK] Don't use deprecated gtk_style_context_invalidate() #915

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

Conversation

SyntevoAlex
Copy link
Member

GTK sources say:
Deprecated: 3.12: Style contexts are invalidated automatically.

https://www.eclipse.org/swt/faq.php#gtkstartup says:
Eclipse/SWT 4.16.x: GTK+ 3.20.0 and its dependencies
Eclipse/SWT 4.15.x: GTK+ 3.14.0 and its dependencies

This means that it's been at least 3 years since SWT requires GTK 3.20. Sounds safe to stop using the deprecated function now.

Hopefully fixes #697 I couldn't reproduce it in SWT snippet, so I didn't test this with SWT. But when I tested in native snippet, removing gtk_style_context_invalidate() changed things a bit and crash no longer occurred.

Copy link
Contributor

github-actions bot commented Nov 28, 2023

Test Results

     299 files  ±0       299 suites  ±0   5m 42s ⏱️ +2s
  4 095 tests ±0    4 087 ✔️ ±0    8 💤 ±0  0 ±0 
12 197 runs  ±0  12 124 ✔️ ±0  73 💤 ±0  0 ±0 

Results for commit b61252c. ± Comparison against base commit 434d1dd.

♻️ This comment has been updated with latest results.

@SyntevoAlex SyntevoAlex force-pushed the z_alexandr.miloslavskiy/#0589_DropStyleContextInvalidate branch from 197c868 to b61252c Compare November 28, 2023 23:51
GTK sources say:
  Deprecated: 3.12: Style contexts are invalidated automatically.

https://www.eclipse.org/swt/faq.php#gtkstartup says:
  Eclipse/SWT 4.16.x: GTK+ 3.20.0 and its dependencies
  Eclipse/SWT 4.15.x: GTK+ 3.14.0 and its dependencies

This means that it's been at least 3 years since SWT requires GTK 3.20.
Sounds safe to stop using the deprecated function now.

Signed-off-by: Alexandr Miloslavskiy <[email protected]>
@SyntevoAlex SyntevoAlex force-pushed the z_alexandr.miloslavskiy/#0589_DropStyleContextInvalidate branch from b61252c to fed0eb7 Compare November 29, 2023 01:26
@SyntevoAlex SyntevoAlex merged commit b7dee8a into eclipse-platform:master Nov 29, 2023
@SyntevoAlex
Copy link
Member Author

Unfortunately it didn't fix #697.
Still, let's have this code cleanup.
In master now.

@SyntevoAlex SyntevoAlex deleted the z_alexandr.miloslavskiy/#0589_DropStyleContextInvalidate branch November 29, 2023 01:56
@iloveeclipse
Copy link
Member

Note: there were no one successful gerrit build for this PR:

image

This (among other issues) caused errors in building SWT GTK related code, see eclipse-platform/eclipse.platform.releng.aggregator#1608.

I assume version updates are missing for GTK fragments, but I'm not sure. I'm looking into this.

@akurtakov
Copy link
Member

@iloveeclipse
Copy link
Member

https://download.eclipse.org/eclipse/downloads/drops4/I20231129-0600/buildlogs/reporeports/reports/versionChecks.html shows that both swt host and fragments have version updates.

OK, the diff shows that bytecode change is related to this PR. The new version is what we actually should use. So if the versions are bumped, why do we have the problem?

@iloveeclipse
Copy link
Member

The API errors are reported because classes & sources changed in

  • eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.linux.aarch64/pom.xml
  • eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.linux.ppc64le/pom.xml
  • eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.linux.x86_64/pom.xml

Here the excerpt:

3.  eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.linux.x86_64/pom.xml
   no-classifier: different
      org/eclipse/swt/internal/gtk3/GTK3.class: different
      org/eclipse/swt/widgets/Control.class: different
      org/eclipse/swt/widgets/Display.class: different
      org/eclipse/swt/widgets/Text.class: different
      org/eclipse/swt/widgets/ToolTip.class: different
      org/eclipse/swt/widgets/Tracker.class: different
      org/eclipse/swt/widgets/Widget.class: different
   classifier-sources: different
      library/gtk3.c: different
      library/gtk3_stats.h: different
      org/eclipse/swt/internal/gtk3/GTK3.java: different
      org/eclipse/swt/widgets/Control.java: different
      org/eclipse/swt/widgets/Display.java: different
      org/eclipse/swt/widgets/Text.java: different
      org/eclipse/swt/widgets/ToolTip.java: different
      org/eclipse/swt/widgets/Tracker.java: different
      org/eclipse/swt/widgets/Widget.java: different
    The main artifact has been replaced with the baseline version.
    The following attached artifacts have been replaced with the baseline version: [sources]

@iloveeclipse
Copy link
Member

I will now touch the 3 fragments, if that is the way to go.

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.

SIGSEGV in swt_fixed_resize
3 participants