Skip to content

Consider replacing GTK2 w GTK3 in Linux builds #2927

Closed

Description

@nikolowry

Google recently added a "use_gtk3" build flag to Chormium - export GYP_DEFINES="$GYP_DEFINES use_gtk3=1".

I think most end-users on GTK3 desktops would prefer to use modern widgets. It might be too early to add it as a default, but eventually it be nice.

Video of Chromium 47 w gtk3:
https://www.youtube.com/watch?v=TJidbdaHCYc

This somewhat relates to an old issue I opened up:
#765

Activity

  1. changed the title [-]Consider using GTK3 in Linux as default[/-] [+]Consider replacing GTK2 w GTK3 in Linux builds[/+] on Sep 28, 2015
  2. zcbenz commented on Sep 29, 2015

    @zcbenz
    Contributor

    Sounds good to me after we upgraded to Chrome 47.

  3. bjornharrtell commented on Dec 12, 2015

    @bjornharrtell

    Dug into it a bit but still not sure where to put the use_gtk3 flag.. @zcbenz willing to do it?

  4. flying-sheep commented on Dec 23, 2015

    @flying-sheep
    Contributor

    @zcbenz or can you give us pointers on where to put it?

  5. netsgnut commented on Dec 24, 2015

    @netsgnut

    I am no expert in the building behaviors behind the build system for Chromium, but reading from the Chromium related bug there, it should be fine we add it to the variables to common.gypi. The relevant line is here.

    Actually I am testing on a Linux box for that, too. My current development box runs Elementary OS, and whenever a Gtk2 application is executed it would display a warning Gtk-Message: Failed to load module "pantheon-filechooser-module" (Ref). If things go smooth (hopefully) let's see if I can get a PR too. Would definitely love your inputs there though.

  6. fidalgo commented on Feb 11, 2016

    @fidalgo

    Any update on this? As a atom user I would like to see it using GTK3 instead of GTK2.

  7. flying-sheep commented on Feb 11, 2016

    @flying-sheep
    Contributor

    @netsgnut does it work well?

    what do the “%” mean?

    is the only change this one?

    diff --git a/common.gypi b/common.gypi
    index 7c41c36..d00d7f7 100644
    --- a/common.gypi
    +++ b/common.gypi
    @@ -9,6 +9,7 @@
         'chromeos': 0,
         # Reflects node's config.gypi.
         'component%': 'static_library',
    +    'use_gtk3': 1,
         'python': 'python',
         'openssl_fips': '',
         'openssl_no_asm': 1,
  8. moimael commented on Mar 1, 2016

    @moimael

    Any news ? The GTK2 open file dialog is quite a pain to use !

  9. netsgnut commented on Mar 3, 2016

    @netsgnut

    @flying-sheep Ah, sorry for the long radio silence. Been committed to other projects off GitHub, my bad.

    Back to our case, that was what I originally think should work, but mysteriously fails to build proper Gtk3 applications on my box. In my case, my original intention is to make an Electron build that would not emit error under my development box (which is running Elementary OS Freya). However it seems building that way won't really make the warning go away.

  10. flying-sheep commented on Mar 6, 2016

    @flying-sheep
    Contributor

    in #4642, @zcbenz said:

    The use_gtk3 flag is only meaningful under Chromium's side, to enable GTK3 we need to enable it in libchromiumcontent first, and then change the link settings in Electron.

    so what exactly needs to be done?

    1. enable using GTK3 in libchromiumcontent: will adding a flag in chromiumcontent.gypi be sufficient? is this of importance or does electron not use that target build?
    2. change the link settings in Electron: where to do this?
  11. netsgnut commented on Mar 6, 2016

    @netsgnut

    I am no expert on this field, and not sure if I have misapprehended @zcbenz's comment; just my 2 cents.

    Regarding the questions:

    1. Probably not. libchromiumcontent seems, from the look of it, a bunch of scripts that downloads chromium source from upstream, patches, and repackages for use in Atom. Apart from changing a flag on chromiumcontent.gypi as you have mentioned, at least dependency libraries are packaged properly as well. See the instances of libgtk2ui.
    2. There are fragments in Electron that references to libgtk2-specific UIs. Those point to a dependency within chromium (and/or derivatives). "Links" as in @zcbenz's comment probably refer to those.

    The tracking bug on Chromium reflects some sort of status from upstream. One of the commenters note:

    IIRC, it would require building a libgtk3ui library to match chrome/browser/ui/libgtk2ui/, and have these two libraries switched at startup time.

    And, as of writing, libgtk3ui does not exist yet :( You may have a look at the code on libgtk2ui as well.

  12. 77 remaining items

  13. zcbenz commented on Nov 27, 2017

    @zcbenz
    Contributor

    Electron is now using GTK3 in the master branch, will be shipped in next minor/major release.

  14. ShalokShalom commented on Jan 9, 2018

    @ShalokShalom

    @ahjolinna

    Thanks that you spend some sanity on this discussion.

    You might be really interested into KaOS, which was already mentioned.
    It is maintained by the very person who made Chakra great for several years, IMHO.

    @ALL

    GTK+ 3 got released when?

    7 years ago.

    Let that melt in your mouth for a while.

    And a huge bunch of software projects are still sitting on 2.
    Since porting is that of a pleasure..

    XFCE, Mate and a huge bunch of others took 6 years to port the code.
    Other projects switched completely from GTK to Qt within 2.

    And yes: GTK+ is developed by GNOME, even the repo is sitting there.
    It is - by nature and definition - developed for GNOME and nothing else.

    Qt is developed for true and native integration into several platforms.

    Electron is what?

    A GNOME shop?

    Nice one.

    Clever thinking.

    Its the same as in imperative and functional programming, as well as in so many other aspects here in this scene: Redundant, old, outdated software is often treated as an addictive drug, which makes it to one.

    And new, clever, innovative software gets treated by misconception and pure ignorance.

    10, 12 projects switched from GTK+ to Qt while I dont know of a single case, where the other way around happened.

    Let this melt on your tongue again: That means a complete rewrite of their whole, integrated UI code.
    Deeply nested, often.

    Which means they prefer that, compared to a major upgrade of their existing tool.
    And all of them are happy with that decision, until today.

    Ask them.

    Before your follow the herd without considering alternatives.

    @ahjolinna posted you a video of one of these persons, VLC, Wireshark, LXQt and other remarkable software projects are also formerly based on GTK.

    GTK is just used in Chromium as a binding to Aura and this only at Linux/freeBSD/Solaris and so on:
    Windows and macOS builds are free of it.

    😉

  15. martpie commented on Jan 9, 2018

    @martpie

    Though I get your points @ShalokShalom, no need to be rude, Electron follows what is delivered by the Chromium team.

    The fork button is at the top btw, feel free.

  16. flying-sheep commented on Jan 9, 2018

    @flying-sheep
    Contributor

    Yeah, this was unnecessarily abrasive.

    But I agree. GTK has too much unnecessary breakage that causes pain, Qt would have been a better choice

    • IF QtWebEngine provides enough access to the underlying chromium instance
    • IF QtWebEngine tracks the newest Chromium quickly enough

    I suggest we move the discussion to a more appropriate place. @ShalokShalom, how about you just open a new issue here and describe the problem in a more civil manner than you did just now?

  17. jhasse commented on Jan 9, 2018

    @jhasse

    VLC, Wireshark, LXQt and other remarkable software projects are also formerly based on GTK.

    That isn't true. VLC was using wxWidgets before Qt, not GTK: https://wiki.videolan.org/WxWidgets_Interface/

  18. bjornharrtell commented on Jan 9, 2018

    @bjornharrtell

    Seems to me GTK folks have since quite some time acknowledged that they did not communicate breakage and versioning well enough in the 3.x series and will try harder in the future with better and more clear long term stability as can be read at https://blog.gtk.org/2016/09/01/versioning-and-long-term-stability-promise-in-gtk/.

    I would also say that Qt and GTK cannot be fairly compared one to one due to different history, backing and goals and in my opinion they both have pros and cons depending on your point of view.

    Stating that GTK is made for and only for the GNOME project is also in my opinion an unfair blanket statement.

  19. flying-sheep commented on Jan 9, 2018

    @flying-sheep
    Contributor

    ha! i really didn’t know about those plans. seems like they’ve learned at last. let’s hope they start considering any breaking change in CSS a real breaking change.

    the last thing i heard was the… umm… excentric GTK 4.0 is not GTK 4. so the’re finally arriving at something almost as good as semver! they do almost as good as Qt did 20 years ago! 😁

  20. polarathene commented on Mar 5, 2018

    @polarathene

    We should see Electron with native GTK3 support by default soon based on this twitter post:

    Electron 2.0.0-beta.1 is out with updated Chromium and Node.js, macOS in-app purchases, GTK3 support for Linux, and much more.

  21. ckerr commented on Mar 5, 2018

    @ckerr
    Member

    Yes. The real work for this was done by the Chromium authors and Electron got it through the Chromium upgrade in Electron 2.0.0.

    In addition, Electron's own code got GTK3ified in #11879

  22. ShalokShalom commented on Mar 5, 2018

    @ShalokShalom

    Yeah, this was unnecessarily abrasive.
    But I agree. GTK has too much unnecessary breakage that causes pain, Qt
    would have been a better choice
    IF QtWebEngine provides enough access to the underlying chromium instance
    IF QtWebEngine tracks the newest Chromium quickly enough

    Well, this is the main issue. People consider what is the quickest to implement for them, which is fine, while they forget very often that the actual implementation to get it running is something very different from the long term maintainence.

    Its crystal clear from my point of view, that the mentioned issues can get tackled.

    Once you compare the amount of coders who actually work on GTK3 ports and those who port their whole UI code on a new toolkit, can you see how amazing the difference is. I think I already posted a video about it, called 'From GTK to Qt: A strange journey.'

    Why focusing on outdated software, simply because it seems ready to use, instead of hacking in the support in Qt?

    Its that 'I use what seems to be ready' dogma, which completely ignores long term decisions. Yes, it might look like that it takes a bit more effort in the first place, while you guys surely benefit from the modern toolkit once implemented.

    Its also not that drastic, that QtWebEngine does not follow Chrome that quickly:
    Its quick enough and Qupzilla proves that you can do amazing stuff with it - especially in a suitable environment, such as KaOS.

    Do you really think you need 'more access to the underlying Chromium' and that 'QtWebEngine does not follow Chromium quickly enough' since Qupzilla and other software proves to ship amazing software, maintained by one single coder?

    You think you need more access and quicker following as a full fledged web browser in Electron? How so?

    Now, you sit on this clumsy software stack in so much projects and small teams manage to port 40-60% of their deeply nested code to Qt quick and efficient;

    Something they did not manage to do from GTK 2 to GTK 3, which is quite amazing. As said: Most projects took 6-7 years to upgrade a major version

    And nearly everyone seems to ignore that? Its so sad, that in an initially scientific community, so primitive decisions continue to spread.

    Peace :)

  23. eternal-sorrow commented on Mar 5, 2018

    @eternal-sorrow

    @ShalokShalom, what do you mean by "outdated software"? GTK+? Any reason you say that?

  24. jtojnar commented on Mar 5, 2018

    @jtojnar

    Please stop with this Qt spam, this is an issue about GTK 3 port. If you feel the need to convince maintainers to switch to Qt, open a separate issue. I want to receive news about the implementation progress, not messages from Qt fanboys.

  25. locked as off topic and limited conversation to collaborators on Mar 5, 2018
  26. ckerr commented on Mar 5, 2018

    @ckerr
    Member

    Locking this conversation due to excessive off-topic discussion.

    Locking only addresses a symptom, but is a reasonable quick fix since the move to GTK3 is wrapping up and there's not much left to discuss on this issue's topic of moving from GTK2 to GTK3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions