Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » MILESTONE: gtk3 replaces gtk2 as default linux backend
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52932 is a reply to message #52930] Tue, 14 January 2020 11:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Tue, 14 January 2020 09:21
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


Can you retry now? I have removed dependency on gtkglext, which we are not using anyway.

If it still does not work, do non-GL examples work for you?

Mirek
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52933 is a reply to message #52932] Tue, 14 January 2020 11:51 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
mirek wrote on Tue, 14 January 2020 12:36

...

Can you retry now? I have removed dependency on gtkglext, which we are not using anyway.

If it still does not work, do non-GL examples work for you?

Mirek


Thanks Mirek! Now it works again. Smile

Best regards,

Tom
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52936 is a reply to message #52930] Wed, 15 January 2020 08:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
In my case not only GLCtrl but BEMRosetta compiles and works perfectly.

Could you include a testcase?


Best regards
Iñaki

[Updated on: Wed, 15 January 2020 08:58]

Report message to a moderator

Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52937 is a reply to message #52936] Wed, 15 January 2020 10:23 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Koldo,

It seems (based on the message ID) that you are responding to my message about the GLCtrl issue ( https://www.ultimatepp.org/forums/index.php?t=msg&th=108 94&goto=52930&#msg_52930 ). I do not think it needs any further investigation or testcase as Mirek already solved it. But thank you anyway!

Best regards,

Tom
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52938 is a reply to message #52902] Wed, 15 January 2020 11:38 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
Hi

For linux and BSD, gtk-2.0 is still in umk config (on U++ debian server).

Example: Makefile.in and uMakefile.in files from last snapshot contain "/usr/include/gtk-2.0" and more gtk-2.0 references.
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52940 is a reply to message #52938] Wed, 15 January 2020 17:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
While fixing warnings, I have encountered a little problem: It looks like whole trayicon API was deprecated in gtk3, they simply consider the whole thing "not modern".

What should I do here? Remove TrayIcon from U++/gtk3? Ignore warnings? Or perhaps provide X11 based code?

Mirek
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52941 is a reply to message #52940] Wed, 15 January 2020 17:50 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
I would ignore those warnings for now personally.

Some apps use it in other desktop environment (like KDE) while running in background. Music players for instance.
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52942 is a reply to message #52941] Wed, 15 January 2020 18:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Some posts about it:
https://www.omgubuntu.co.uk/2017/09/will-you-miss-gnome-lega cy-tray
https://stackoverflow.com/questions/41917903/gtk-3-statusico n-replacement


Best regards
Iñaki
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52943 is a reply to message #52902] Thu, 16 January 2020 11:05 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
This sounds like lot of fun.

I guess dropping support for status icons in Gtk is legitimate option, as that's how the Gnome authors envision it and how they want it.

But as a KDE user, I would prefer if there were still APIs and tools in U++ to handle status icons normally.

But U++ is GTK3 based now, so ... I don't know. Maybe the X11 without GTK branch only to keep them supported and GTK3 branch to ignore any U++ API calls?

Seems quite awkward situation to me, I definitely like existence of status icons in the task bar in my desktop environment, and if some app is overusing it, I can uninstall the particular app. But I don't understand Gnome design decisions for many years, so this is just another one, I simply think completely differently about my computer "desk".
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52944 is a reply to message #52943] Thu, 16 January 2020 11:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mr_ped wrote on Thu, 16 January 2020 11:05
This sounds like lot of fun.

I guess dropping support for status icons in Gtk is legitimate option, as that's how the Gnome authors envision it and how they want it.

But as a KDE user, I would prefer if there were still APIs and tools in U++ to handle status icons normally.

But U++ is GTK3 based now, so ... I don't know. Maybe the X11 without GTK branch only to keep them supported and GTK3 branch to ignore any U++ API calls?

Seems quite awkward situation to me, I definitely like existence of status icons in the task bar in my desktop environment, and if some app is overusing it, I can uninstall the particular app. But I don't understand Gnome design decisions for many years, so this is just another one, I simply think completely differently about my computer "desk".


No worries, I have kept it with warnings disabled. Perhaps in future, if they decide to drop it, I can switch to X11 implementation, which is possible even with gtk3 backend. For now, problem solved.

(And yes, it is idiotic decision on gtk3 part. If they present it as multi-platform toolkit, they should care about more than Gnome).

Mirek
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52945 is a reply to message #52944] Fri, 17 January 2020 12:25 Go to previous messageGo to next message
pvictor is currently offline  pvictor
Messages: 67
Registered: December 2015
Member
Hello Mirek,

Apps that are compiled now and TheIDE itself have unusual (swapped) location of buttons OK and Cancel in standard dialogs.

In old gtk2 versions in file ChGtk.cpp:
SwapOKCancel_Write(!Qt);

Now there is nothing like this.

Best regards,
Victor
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52946 is a reply to message #52919] Sat, 18 January 2020 00:42 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Sender Ghost wrote on Sun, 12 January 2020 16:58
There is a difference (marked with red rectangle) between OptionBox of TestChStyle and checkbutton of gtk3-widget-factory. The ✔ mark of OptionBox looks more blurry compared to checkbutton.

Checked for 13910 svn revision. The ✔ mark of OptionBox is not blurry as before, but the the size of its background image is smaller, if compare to checkbutton of gtk3-widget-factory.
https://i.postimg.cc/QHCCPJNS/gtk3-widget-factory-and-Test-Ch-Style-marked-r13910.png
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52947 is a reply to message #52946] Sat, 18 January 2020 10:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Sat, 18 January 2020 00:42
Sender Ghost wrote on Sun, 12 January 2020 16:58
There is a difference (marked with red rectangle) between OptionBox of TestChStyle and checkbutton of gtk3-widget-factory. The ✔ mark of OptionBox looks more blurry compared to checkbutton.

Checked for 13910 svn revision. The ✔ mark of OptionBox is not blurry as before, but the the size of its background image is smaller, if compare to checkbutton of gtk3-widget-factory.
https://i.postimg.cc/QHCCPJNS/gtk3-widget-factory-and-Test-Ch-Style-marked-r13910.png


Cannot solve this without breaking other things.

Mirek
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52948 is a reply to message #52945] Sat, 18 January 2020 10:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
pvictor wrote on Fri, 17 January 2020 12:25
Hello Mirek,

Apps that are compiled now and TheIDE itself have unusual (swapped) location of buttons OK and Cancel in standard dialogs.

In old gtk2 versions in file ChGtk.cpp:
SwapOKCancel_Write(!Qt);

Now there is nothing like this.

Best regards,
Victor


Thanks, fixed. (I have retained the logic that in KDE it is not swapped).

Mirek
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52950 is a reply to message #52902] Mon, 20 January 2020 14:53 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
I have three issues to report.

1. First, there are still references to gtk-2.0 in several files in svn.
The easier way to find them: 'grep -R --exclude-dir=.svn gtk-2.0 .'

2. Secondly, there is a typo in trunk/uppsrc/CtrlCore/CtrlCore.upp. xdmpc should be xdmcp I guess

3. Thirdly, I would like to understand this new strategy:

Extract of trunk/uppsrc/CtrlCore/CtrlCore.upp:

pkg_config(LINUX | FREEBSD) "freetype2 x11 xinerama xrender xft xdmpc fontconfig xcb xext";

pkg_config((LINUX | FREEBSD) !X11) "gtk+-3.0 libnotify";


So now U++ can be compiled with GTK dependencies only (GTK+libnotify) or GTK+X11 dependencies and we need pkg-config to compile CtrlCore?
"xinerama xrender xft xdmcp fontconfig xcb xext" are now mandatory for GTK+X11?

I need to understand this because current domake script is broken as:

* umk on debian server doesn't use '((INCLUDES))' anymore in ~/.upp/theide/GCCMK.bm
* exported Makefiles use pkg-config when using CtrlCore because of trunk/uppsrc/CtrlCore/CtrlCore.upp recent changes
* U++ won't compile if pkg-config is not there because of missing default includes
* Previously we only needed gtk3 x11 and libnotify

Extract of Makefile.in in new tarball snapshots:

CINC   = -I./ `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags libpng` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmpc` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify`

...
		$(OutDir_plugin_bmp)BmpReg.o \
			$(OutDir_plugin_bmp)bmp.a \
			$(OutDir_RichText)RichText.a \
			`pkg-config --libs freetype2` \
			`pkg-config --libs x11` \
			`pkg-config --libs fontconfig` \
			`pkg-config --libs xcb` \
			`pkg-config --libs expat` \
			`pkg-config --libs libpng` \
			`pkg-config --libs xinerama` \
			`pkg-config --libs xrender` \
			`pkg-config --libs xft` \
			`pkg-config --libs xdmpc` \
			`pkg-config --libs xext` \
			`pkg-config --libs gtk+-3.0` \
			`pkg-config --libs libnotify` \
			-lbz2 \
			-lpthread \
			-ldl \
			-lrt \
			-lz -Wl,--end-group

Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52951 is a reply to message #52950] Mon, 20 January 2020 15:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I will fix 1 and 2 ASAP.

3: It is work in progress, however the idea is to depend on pkg-config, with basically empty INCLUDE/LIB paths. Do you know about any system that supports gtk-3 or C++11 and does not have pkg-config?

Mirek

[Updated on: Mon, 20 January 2020 15:06]

Report message to a moderator

Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52953 is a reply to message #52902] Mon, 20 January 2020 20:51 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
All POSIX OS have pkg-config in their repository. You must install pkg-config manually (using the distro package manager) as it's not installed by default when you install other devel packages. If so, this dependency need to be added in docs.

The main idea of using pkg-config is to have dynamic cflags and libs on any POSIX OS I guess.

So for me, the best strategy would be to add LDLIBS in Makefile using pkg-config (after CINC and at link time):

CINC   = -I./ `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags libpng` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmpc` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify`

LDLIBS = `pkg-config --libs freetype2` `pkg-config --libs x11` `pkg-config --libs fontconfig` `pkg-config --libs xcb` `pkg-config --libs expat` `pkg-config --libs libpng` `pkg-config --libs xinerama` `pkg-config --libs xrender` `pkg-config --libs xft` `pkg-config --libs xdmpc` `pkg-config --libs xext` `pkg-config --libs gtk+-3.0` `pkg-config --libs libnotify` -lbz2 -lpthread -ldl -lrt -lz

...
		$(OutDir_plugin_bmp)BmpReg.o \
			$(OutDir_plugin_bmp)bmp.a \
			$(OutDir_RichText)RichText.a \
			$(LDLIBS) -Wl,--end-group


That way, it easier for external script like domake to change Makefiles configuration dynamically using its own CINC and LDLIBS.

Note: It would be even more fun to use Flags to switch Makefile from one configuration to another but my investigation in this area showed several flows because of POSIX gmake differences between OS.

[Updated on: Mon, 20 January 2020 21:02]

Report message to a moderator

Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52954 is a reply to message #52953] Mon, 20 January 2020 21:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amrein wrote on Mon, 20 January 2020 20:51
You must install pkg-config manually (using the distro package manager) as it's not installed by default when you install other devel packages.


I do not think this is correct. I believe it really is present always - I mean like "bash level" kind of presence...

Which makes sense, as its infrastructure is precursor to packaging systems....
Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52955 is a reply to message #52954] Tue, 21 January 2020 10:32 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
Example on Fedora:

$ lsb_release -sir
Fedora 31

$ rpm -q --whatrequires pkg-config
no package requires pkg-config

$ rpm -qa | grep devel | wc -l
114



So on a full Fedora installation with all U++ dependencies installed and much more... not a single package requires pkg-config.
So no, you need to manually install pkg-config on most POSIX OS. It's not more complicated than installing other U++ build dependencies.

[Updated on: Tue, 21 January 2020 10:33]

Report message to a moderator

Re: MILESTONE: gtk3 replaces gtk2 as default linux backend [message #52956 is a reply to message #52955] Tue, 21 January 2020 11:07 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello amrein,

IIRC, Fedora uses the pkgconf package for some time (circa F26?), which in turn uses the pkgconf-pkg-config package to replace pkg-config links.

Can you check that?

Packages list requiring the pkg-conf-pkg-config package is long (see "Required by" section)

https://fedora.pkgs.org/31/fedora-x86_64/pkgconf-pkg-config- 1.6.3-2.fc31.x86_64.rpm.html


Best regards,
Oblivion.


Previous Topic: Happy New Year 2020
Next Topic: ide now has multiple Find in files outputs
Goto Forum:
  


Current Time: Fri Mar 29 00:39:26 CET 2024

Total time taken to generate the page: 0.01231 seconds