Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Replace Xlib with XCB  (Read 3467 times)

0 Members and 1 Guest are viewing this topic.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
Replace Xlib with XCB
« on: April 24, 2014, 12:01:15 am »
So, I've been adding clipboard support to SFML, and Windows was trivial.

Then came Xlib.
Xlib is bad. It hasn't been updated in 12 years.
It's complicated, and slow, and makes you want to throw grapefruit at strangers.

But! XCB exists.
It's more up-to-date, doesn't suck as much.
It's still X, which is a downside.
But let's look at the bright side, it's already implemented, but this PR is a year old, and nothing has been decided.
It's probably out of date, but if the SFML dev team would should a glimmer of interest, I'm sure it would be updated in a single day.

SFML needs to be ported to XCB, it's a question of modern code, and it'll probably even be faster as such.
So yeah, SFML claims to be modern, but it uses a 12-year old, outdated backend.

(Also, newlines, newlines everywhere!)
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Replace Xlib with XCB
« Reply #1 on: April 24, 2014, 01:38:39 am »
After seeing Aster's pain on IRC and after doing some research of my own I totally support this idea  ;D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10225
    • View Profile
    • development blog
    • Email
AW: Re: Replace Xlib with XCB
« Reply #2 on: April 24, 2014, 01:49:43 am »
Both clipboard support and XCB usage will be looked at. Though it seems to me that there are currently more pressuring issues. It will certainly be a post 2.2 thing. ;)

So yeah, SFML claims to be modern, but it uses a 12-year old, outdated backend.
The passive aggressiveness is not needed.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
Re: Replace Xlib with XCB
« Reply #3 on: April 24, 2014, 02:24:57 am »
Clipboard support has been declined on and on again by the SFML dev(s), because it's "inappropriate". However, clipboard support requires access to the window handle on at least 2 of 3 major platforms, and all of SFML's competitors have it.

Now, as for XCB stuff, it doesn't really matter when it gets done, it's just something that should be done for the sake of SFML being more maintainable and easier to make evolve, as I'm sure clipboard support was mostly denied not because of it being "inappropriate", but because it's damned hard to do with Xlib. Also, XCB doesn't change anything from the user's point of view. In fact, it could just be ninja'd into SFML and nobody would notice.

Sorry for the passive aggressiveness. After almost a whole day of trying and way too much coffee, I might be a bit jumpy.
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
Re: Replace Xlib with XCB
« Reply #4 on: April 24, 2014, 02:29:07 am »
Also, ignoring all the crazy feature requests on the forums, SFML doesn't get many new community-contributed features due to everyone being scared of working on it just to never have their PR accepted, or just getting a "no.". Or at least that's how I feel.

And then asking on the forums is mostly "we'll consider it" and "no.".
Hopefully the way SFML evolves will change along with our new SFML "task force". ;)
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Replace Xlib with XCB
« Reply #5 on: April 24, 2014, 07:40:25 am »
No need to argue, the change to XCB has been planned for a long time (that's why there's a task in the tracker, not only a PR), everybody agrees on it. We just need to find someone in the team with enough time and motivation to review this huge pull request (and update it, since it's so old now) ;)

Quote
Hopefully the way SFML evolves will change along with our new SFML "task force".
For sure it will.

And if you want to discuss clipboard support, let's do it in a separate thread please.
Laurent Gomila - SFML developer

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Destrock
Re: Replace Xlib with XCB
« Reply #6 on: April 24, 2014, 08:11:09 am »
Right. I just hope it gets merged soon now that it's been brought up again.
I don't think clipboard support needs a forum thread again. I'll just finish up my PR, and it'll be discussed there. I guess.
My website.
BuildMyCode developer.
My GitHub: https://github.com/Mischa-Alff
Twitter: https://twitter.com/MisterAster
Aster @ irc.boxbox.org, irc.esper.net, chat.freenode.net

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1485
    • View Profile
    • Blog
    • Email
Re: Replace Xlib with XCB
« Reply #7 on: April 25, 2014, 09:08:55 am »
I've taken a look at the patch, rebased it onto master/HEAD, squelched some bugs and pushed the results to a new branch feature/xcb.

All demos except "X11" work on my side. I've also tested all possible events, and they do all work (there was one bug where a key release spawned a sf::Event::KeyPressed event).

However it has been tested on Arch Linux only yet and the fact that the X11 demo crashes worries me a little bit. My guess is that it's related to the way how the X11 demo does things, i.e. using the "old" X functions to initialize things, like the windows.

If there's an experienced XCB guy around with some time on hands, we can investigate the problems together -- I could need some help here. Otherwise I will have to dive into the deep waters of X(CB) programming, and we all know how hard that will be. :P

 

anything