Community
Participate
Working Groups
An optional GTK3 port for Windows could be usable for people wanting full styling options(which are not provided by win32)
Should be mostly releng/dynamic loading to be figured as latest SWT on GTK port has X11 conditioned(verified by Wayland/Broadway ports) so no real significant work on widgets expected.
Created attachment 259920 [details] Light example
Created attachment 259921 [details] Dark example
The above screenshots were taken after installing a sample genealogy app https://gramps-project.org/wiki/index.php?title=Download#MS_Windows on a pristine Windows 7 machine. It is using GTK 3.18.
It looks really promising.
As a note, besides releng, the css theming will probably have to be changed too (because effectively, when on windows/GTK, I think we'd like to use the theming which is used for Linux/GTK in this case and not Windows -- I'm guessing most checks currently check for the OS, not the SWT backend, so, I think a number of assumptions may be broken here).
(In reply to comment #6) > As a note, besides releng, the css theming will probably have to be changed too > (because effectively, when on windows/GTK, I think we'd like to use the theming > which is used for Linux/GTK in this case and not Windows -- I'm guessing most > checks currently check for the OS, not the SWT backend, so, I think a number of > assumptions may be broken here). True, work on the theming engine will have to be done, to make it at least know that the underlying UI toolkit has the notion of Dark/Light itself. Something that GTK has for quite some time and Windows 10 has in a way too.
New Gerrit change created: https://git.eclipse.org/r/82800
To get the build environment for the windows port, to build the attached patch: 1) Install msys2: https://msys2.github.io/ 2) Update msys2: pacman -Syuu 3) Install toolchain and dependencies: pacman -S mingw-w64-x86_64-toolchain pacman -S mingw-w64-x86_64-gtk2 pacman -S mingw-w64-x86_64-webkitgtk2 pacman -S mingw-w64-x86_64-gtk3 pacman -S mingw-w64-x86_64-webkitgtk3 4) Switch to GTK classpath 5) Open a MINGW64 console 6) Ensure that JAVA_HOME in the console contains unix slashes 'e.g. C:/Java/jdk8' 7) Execute the build in the bin/library folder ./build.sh
(In reply to Rolf Theunissen from comment #9) > To get the build environment for the windows port, to build the attached > patch: > > 1) Install msys2: > https://msys2.github.io/ > 2) Update msys2: > pacman -Syuu > 3) Install toolchain and dependencies: > pacman -S mingw-w64-x86_64-toolchain > pacman -S mingw-w64-x86_64-gtk2 > pacman -S mingw-w64-x86_64-webkitgtk2 > pacman -S mingw-w64-x86_64-gtk3 > pacman -S mingw-w64-x86_64-webkitgtk3 > 4) Switch to GTK classpath > 5) Open a MINGW64 console > 6) Ensure that JAVA_HOME in the console contains unix slashes 'e.g. > C:/Java/jdk8' > 7) Execute the build in the bin/library folder > ./build.sh That's awesome. Do you have screenshots? I'll dig into the patch during the week.
(In reply to Rolf Theunissen from comment #9) > To get the build environment for the windows port, to build the attached > patch: > > 1) Install msys2: > https://msys2.github.io/ > 2) Update msys2: > pacman -Syuu > 3) Install toolchain and dependencies: > pacman -S mingw-w64-x86_64-toolchain > pacman -S mingw-w64-x86_64-gtk2 > pacman -S mingw-w64-x86_64-webkitgtk2 > pacman -S mingw-w64-x86_64-gtk3 > pacman -S mingw-w64-x86_64-webkitgtk3 > 4) Switch to GTK classpath > 5) Open a MINGW64 console > 6) Ensure that JAVA_HOME in the console contains unix slashes 'e.g. > C:/Java/jdk8' > 7) Execute the build in the bin/library folder > ./build.sh Have you tried webkitgtk4? We are working towards making it fully supported as webkitgtk project no longer provides security updates for webkitgtk2 and webkitgtk3. Also I would rather see new work like that not include gtk2 (AFAIK LnF on windows is not good for it) and obsolete things like mozilla/xulrunner which are known to not work on any non-ancient system.
New Gerrit change created: https://git.eclipse.org/r/82801
Another note, to run the code ensure that MINGW64 is on the PATH environmental variable. E.g.: ${env_var:PATH};C:\msys64\mingw64\bin
Created attachment 264752 [details] Screenshot of Snippet10 on gtk-win32
(In reply to Rolf Theunissen from comment #14) > Created attachment 264752 [details] > Screenshot of Snippet10 on gtk-win32 Great, I've reviewed the patch, there are some issues with it. Overall, try to push smaller patches to make it easier for review. All of them can refer to this bug so you don't open bugs for each patch.
Created attachment 265122 [details] File describing steps taken to compile swt againt gtk on windows Hi, I tried to follow the steps as described in the patch. However, I get stuck execution ./build.sh -gtk3 with the followin result: $ ./build.sh -gtk3 Cairo found, compiling SWT support for the cairo graphics library. *** None of the following libraries were found: Mozilla/XPCOM, Firefox/XPCOM, or XULRunner/XPCOM: *** >> Mozilla embedding support will not be compiled. *** libjawt.so not found, the SWT/AWT integration library will not be compiled. Building SWT/GTK+ for Architectures: win32 x86_64 Building GTK3 bindings: make_win32.mak:14: make_common.mak: No such file or directory make: *** No rule to make target 'make_common.mak'. Stop. *** GTK3 Build failed, aborting further actions.. From what I can gather the ./build.sh should be run from /eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library make_common.mak however resides at /eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/common/library with the required swt.c and swt.h files. --> Not sure what I am doing wrong or which step I missed. Please note: I don't mean to clutter your bug report so I gladly post this somewhere else. Furthermore, let more know if me trying to get this to run is of any help to you or if I can help in some other way that is of more benefit to you. Anyways, fantastic work!!
The build instruction that I used are part of the SWT FAQ: https://www.eclipse.org/swt/faq.php#howbuilddll paragraph: 'Building the SWT JNI libraries from the eclipse GIT repository' Make sure that Eclipse has compiled the project first, then execute the build.sh script in the 'org.eclipse.swt/bin/library' directory.
(In reply to Rolf Theunissen from comment #17) > The build instruction that I used are part of the SWT FAQ: > > https://www.eclipse.org/swt/faq.php#howbuilddll > > paragraph: 'Building the SWT JNI libraries from the eclipse GIT repository' > > Make sure that Eclipse has compiled the project first, then execute the > build.sh script in the 'org.eclipse.swt/bin/library' directory. Thank you very much - that worked for me: GTK3 Build succeeded I successfully ran some of the SWT examples. Please let me know if there is anything I can contribute. Maybe there is some testing I can do you guys, for example. This looks really great! Cheers
New Gerrit change created: https://git.eclipse.org/r/89885
New Gerrit change created: https://git.eclipse.org/r/89884
New Gerrit change created: https://git.eclipse.org/r/89883
New Gerrit change created: https://git.eclipse.org/r/89882
New Gerrit change created: https://git.eclipse.org/r/89886
with the patches in gerrit: At least the following know issues remain due to X11 and platform restrictions: - OpenGL integration: GTK OpenGL dependency depends on GLX (X11 only) - AWT integration: GTK-SWT-AWT depends on X11 - Mozilla delegate: GTK implementation assumes *nix Mozilla - Printing: GTK-SWT printing depends on gtkunixprint Know issues; All testcases run, however the following failures occur: - Cut/Copy/Past of styled test (3) - Printer related test (11) - GTK3: some failures related to the size of widgets (4) - All browser test fail (9)
Gerrit change https://git.eclipse.org/r/89882 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=7a56c8fe130806e7d288476082ba0a55e1803797
Gerrit change https://git.eclipse.org/r/89885 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=186821612d234bb2c3dfc3d1d72a2228cb9e4472
Gerrit change https://git.eclipse.org/r/89883 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=7c4d24ebd16cee2eb28c5cd36cd7a48009d53647
Gerrit change https://git.eclipse.org/r/89884 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b2b074e905370589f1d760675c8b34a8eab3f0e8
Gerrit change https://git.eclipse.org/r/89886 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=20d0b6f0b5f86d1745ec3e9f2d6da9ff62241fbf
New Gerrit change created: https://git.eclipse.org/r/119158
New Gerrit change created: https://git.eclipse.org/r/119159
New Gerrit change created: https://git.eclipse.org/r/119160
New Gerrit change created: https://git.eclipse.org/r/119169
New Gerrit change created: https://git.eclipse.org/r/119170
Gerrit change https://git.eclipse.org/r/119169 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=07296b07e60190da648c102f48a394453878cd9b
Gerrit change https://git.eclipse.org/r/119159 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ade68b5881c75e9ada29a2c6f0d946f2802551ec
Gerrit change https://git.eclipse.org/r/119160 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=7ff1827cdc8b28d83309c71b9acc5929c7997319
Gerrit change https://git.eclipse.org/r/119158 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=e061a646a35408e4c4cbd20733baa1f7e304be3e
New Gerrit change created: https://git.eclipse.org/r/120802
Created attachment 273463 [details] Screenshot of Eclipse running on gtk-win32 After the previous Gerrit change is applied, it is possible to launch Eclipse on the gtk-win32 port, see the attached screenshot. Current status of the port: Unsupported features: - Printing - Browser - GLCanvas (needs port to GtkGLArea, see Bug 519114) - SWT_AWT (I have a prototype running) Failing test-case with GTK3 (Something with UTF in Pango): - org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_TextLayout test_getNextOffset(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_TextLayout) java.lang.AssertionError: expected:<8> but was:<9> Additional failing test-case with GTK2 (Bug 404946): - org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Display test_getActiveShell(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Display) java.lang.AssertionError: expected same:<Shell {test_getActiveShell}> was not:<null>
(In reply to Rolf Theunissen from comment #40) > Created attachment 273463 [details] > Screenshot of Eclipse running on gtk-win32 Wow, that's pretty cool. > Unsupported features: > - Browser I did the Webkit2 port. Is there something I can do to get SWT-Gtk-Win to work with Webkit on Windows? Is the Gtk-webkit (webkitgtk) available on windows like gtk? > Additional failing test-case with GTK2 (Bug 404946): I think we can ignore gtk2 altogether since we'll be dropping gtk2 support anyway. But good to know.
(In reply to Leo Ufimtsev from comment #41) > (In reply to Rolf Theunissen from comment #40) > > Unsupported features: > > - Browser > > I did the Webkit2 port. Is there something I can do to get SWT-Gtk-Win to > work with Webkit on Windows? > Is the Gtk-webkit (webkitgtk) available on windows like gtk? > Webkitgtk is currently not supported on windows, see [1]: [GTK] Add back the Win32 target. I have been looking to get it compile again, but I seem to run in problems with code-generators in webkit. So I won't expect webkitgtk on windows soon. Another browser backend is needed. [1] https://bugs.webkit.org/show_bug.cgi?id=137488
Gerrit change https://git.eclipse.org/r/120802 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=148086d9b53e0d2c51fe0087cd4acad1f77878ba
Gerrit change https://git.eclipse.org/r/119170 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/commit/?id=96685512141a349413afcc494a73c21cdfdf1bcb
New Gerrit change created: https://git.eclipse.org/r/131155
It has been a while, but I wanted to give an update on some thing I worked on before, but ran into problems to complete them. 1. Printing; GTK offers an portable API based on callbacks. SWT uses a job based printing system. For Unix, GTK offers a Job based printing system too. Therefore, it is pretty hard to use portable GTK code here. Either the GTK job based system should be ported to win32, or SWT/gtk/win32 should use its own backend. 2. Equinox Launcher; The launcher used by GTK is (partly) not written in portable GTK code, therefore, it won't compile (easily) on win32. Here, either the win32 launcher can be adapted to launch the GTK version, or the GTK launcher can be ported to GTK code. 3. Code sharing; Some win32 specific parts are not offered by GTK. They are supported by SWT/win32, it seems natural to share some code between SWT/win32 and SWT/gtk/win32. However, this would impact SWT/win32 quite a bit, for instance by splitting out OS and platform dependent things, to make SWT/win32 and SWT/gtk compatible.
Gerrit change https://git.eclipse.org/r/131155 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=71d4628ff442988b9e1390dd75baa7be4e6aec3f
Created attachment 278954 [details] First attempt on a swt-gtk-win32 launcher I was going over my old code, and I still have a prototype laying around for trying to make a launcher that can launch the gtk-win32 port directly. I have not looked into the code for a while now, and some clean up would be needed. But I don't think I will finish any of it soon. Anyhow, the code becomes quite messy as the current GTK launcher assumes a *nix environment. The easiest way to get a launcher, is to use the existing win32 launcher and provide '-ws gtk -noSplash' as an options. After bootstrapping an installation that includes the win32-gtk fragments.
I'm going to mark this one as wontfix. With recent developments of WSL/WSL2 it's better suited for using swt/gtk on windows.
Shall we maybe removed the bundle from SWT ? I understand that the work was never finished, and it just stays there, confusing me once in a while - whenever I change something about win32 build settings, I wonder if I should or should not apply them to win32/gtk as well. I understand that this took quite some hours to try to implement and I offer my apologies for suggesting to forget all of this. Still, I think that it would be best
Reading between the lines, I understand that the goal was to have dark theme in SWT for Windows. But now it's already implemented for Win10.
Feel free to do it. This one didn't manage to fly (although I believe it could serve SWT well).
Will be removed in https://github.com/eclipse-platform/eclipse.platform.swt/issues/425