|
|
Home » Community » U++ community news and announcements » MILESTONE: gtk3 replaces gtk2 as default linux backend
MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52902] |
Fri, 10 January 2020 10:38  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
I have reached an important milestone, commiting gtk3 branch (which I have been developing for the last couple of month) into U++ trunk.
This replaces gtk2 as our backend (BTW, small explanation here for future references: U++ is still 'emulated' GUI, with its own set of widgets; we are using gtk just as interface to host system, basically only top-level windows and events. The reason for using gtk3 as backend is mostly for improved integration).
With this backend I have also taken slightly different path for chameleon - we are now using only several basic 'looks' from gtk3 (namely shape of basic buttons, check/option boxes, menu looks, scrollbars, standard font and GUI colors) and generate rest (e.g. comboboxes) as "synthetic" GUI based on these. That should fix many small visual glitches that have plagued U++ in the past, especially with some exotic theming. Plus, unlike gtk2, gtk3 has support for UHD mode, so looks much better on my LCD 
Minimal version required for gtk3 is 3.8 - that accidentally coincides in historic timeline with C++11 support availability; for now however at least 3.22 (~2017) is required for full chameleon support. I also plan to develop some nice new default clean theme to replace that old XP look which was our fallback look for more than 10 years... that will probably be the theme for pre-3.22 gtk3 and definitely for plain X11.
It will take a month or two to mature this, please test & report problems...
|
|
|
|
|
|
|
|
|
|
|
|
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52914 is a reply to message #52913] |
Sat, 11 January 2020 21:26   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
While compiling new version I see a lot of warnings that should be eliminated:
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp: In function 'void Upp::_DBG_Ungrab()':
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:24:37: warning: 'void gdk_pointer_ungrab(guint32)' is deprecated: Use 'gdk_device_ungrab' instead [-Wdeprecated-declarations]
24 | gdk_pointer_ungrab(GDK_CURRENT_TIME);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:100:15: note: declared here
100 | void gdk_pointer_ungrab (guint32 time_);
| ^~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:24:37: warning: 'void gdk_pointer_ungrab(guint32)' is deprecated: Use 'gdk_device_ungrab' instead [-Wdeprecated-declarations]
24 | gdk_pointer_ungrab(GDK_CURRENT_TIME);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:100:15: note: declared here
100 | void gdk_pointer_ungrab (guint32 time_);
| ^~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp: In static member function 'static void Upp::Ctrl::PanicMsgBox(const char*, const char*)':
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:30:28: warning: 'gboolean gdk_pointer_is_grabbed()' is deprecated: Use 'gdk_display_device_is_grabbed' instead [-Wdeprecated-declarations]
30 | if(gdk_pointer_is_grabbed())
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:104:15: note: declared here
104 | gboolean gdk_pointer_is_grabbed (void);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:30:28: warning: 'gboolean gdk_pointer_is_grabbed()' is deprecated: Use 'gdk_display_device_is_grabbed' instead [-Wdeprecated-declarations]
30 | if(gdk_pointer_is_grabbed())
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:104:15: note: declared here
104 | gboolean gdk_pointer_is_grabbed (void);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:31:33: warning: 'void gdk_pointer_ungrab(guint32)' is deprecated: Use 'gdk_device_ungrab' instead [-Wdeprecated-declarations]
31 | gdk_pointer_ungrab(CurrentTime);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:100:15: note: declared here
100 | void gdk_pointer_ungrab (guint32 time_);
| ^~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:31:33: warning: 'void gdk_pointer_ungrab(guint32)' is deprecated: Use 'gdk_device_ungrab' instead [-Wdeprecated-declarations]
31 | gdk_pointer_ungrab(CurrentTime);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:50,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkmain.h:100:15: note: declared here
100 | void gdk_pointer_ungrab (guint32 time_);
| ^~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp: In function 'void Upp::InitGtkApp(int, char**, const char**)':
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:70:61: warning: 'void gdk_threads_set_lock_functions(GCallback, GCallback)' is deprecated [-Wdeprecated-declarations]
70 | gdk_threads_set_lock_functions(EnterGuiMutex, LeaveGuiMutex);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:61,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkthreads.h:50:10: note: declared here
50 | void gdk_threads_set_lock_functions (GCallback enter_fn,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:70:61: warning: 'void gdk_threads_set_lock_functions(GCallback, GCallback)' is deprecated [-Wdeprecated-declarations]
70 | gdk_threads_set_lock_functions(EnterGuiMutex, LeaveGuiMutex);
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:61,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkthreads.h:50:10: note: declared here
50 | void gdk_threads_set_lock_functions (GCallback enter_fn,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:71:19: warning: 'void gdk_threads_init()' is deprecated [-Wdeprecated-declarations]
71 | gdk_threads_init();
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:61,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkthreads.h:44:10: note: declared here
44 | void gdk_threads_init (void);
| ^~~~~~~~~~~~~~~~
In file included from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:522:
/home/klugier/upp/uppsrc/CtrlCore/GtkApp.cpp:71:19: warning: 'void gdk_threads_init()' is deprecated [-Wdeprecated-declarations]
71 | gdk_threads_init();
| ^
In file included from /usr/include/gtk-3.0/gdk/gdk.h:61,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/klugier/upp/uppsrc/CtrlCore/Gtk.h:12,
from /home/klugier/upp/uppsrc/CtrlCore/CtrlCore.h:49,
from /home/klugier/upp/uppsrc/CtrlCore/SystemDraw.cpp:1,
from /home/klugier/upp.out/CtrlCore/GCC.Blitz.Gui.Mt.Shared/$blitz.cpp:3:
/usr/include/gtk-3.0/gdk/gdkthreads.h:44:10: note: declared here
44 | void gdk_threads_init (void);
| ^~~~~~~~~~~~~~~~
CtrlCore: 61 file(s) built in (0:05.19), 85 msecs / file, duration = 12061 msecs, parallelization 61%
ide: 64 file(s) built in (0:34.03), 531 msecs / file, duration = 39637 msecs, parallelization 24%
Linking...
/home/klugier/upp/theide (13145136 B) linked in (0:00.95)
Moreover, the tooltip text is not visible on Manjaro KDE. I also agree that there is a problem with the scrollbars - they are not emulated ideally.

Sincerely,
Klugier
U++ - one framework to rule them all.
|
|
|
|
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52916 is a reply to message #52914] |
Sun, 12 January 2020 13:36   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Klugier wrote on Sat, 11 January 2020 21:26Hello Mirek,
While compiling new version I see a lot of warnings that should be eliminated:
Well, most important warnings of those are about gtk3 more or less dropping support for multithreading - if remember some history of U++, we were at phase where the only thread eligible to do GUI was the main thread, then we went to some limited possibility to do things from other threads. If other thread was to do something in GUI, you had to PostCallback.
Interestingly, gtk just went in the exactly opposite direction - doing some GUI stuff from other threads is now deprecated and dropped in gtk4 and the recommend approach is to use their's PostCallback equivalent.
Now I have some ideas how to deal with it, but it will take some time.
(Plus of course there are some easier warnings to fixe, 'todo').
Quote:
Moreover, the tooltip text is not visible on Manjaro KDE. I also agree that there is a problem with the scrollbars - they are not emulated ideally.
Can you post tooltip screenshot? If not, can you describe colors?
Scrollbars I can fix. Would be nice to know which engine is that though...
Mirek
|
|
|
|
|
|
|
|
|
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52930 is a reply to message #52926] |
Tue, 14 January 2020 09:21   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
My OpenGL (GLCtrl) based applications now crash on startup. I did a full rebuild, but still the result is this:
tom@tom-LM-WMV:~/upp.out/program52/CLANG.Gui.Shared$ ./GLModeler
(GLModeler:5955): Gtk-ERROR **: 10:07:31.280: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap (core dumped)
tom@tom-LM-WMV:~/upp.out/program52/CLANG.Gui.Shared$
Here's the backtrace:
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_writer_default () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_structured_array () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_log_structured_standard () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0
g_option_context_parse () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
gtk_parse_args () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
gtk_init_check () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
gtk_init () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
Upp::InitGtkApp (argc=1, argv=0x7fffffffe448, envptr=0x7fffffffe458) at /home/tom/upp.src/uppsrc/CtrlCore/GtkApp.cpp:74
main (argc=1, argv=0x7fffffffe448, envptr=0x7fffffffe458) at /mnt/hgfs/program52/GLModeler/GLModeler.cpp:3
Am I doing something wrong here? (I have not changed anything in my code and it used to work on Linux. It still works on Windows.)
Best regards,
Tom
|
|
|
Goto Forum:
Current Time: Fri Apr 25 19:07:37 CEST 2025
Total time taken to generate the page: 0.01483 seconds
|
|
|