Recent

Author Topic: QT6 and new stuff  (Read 3506 times)

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #15 on: November 28, 2022, 08:21:16 am »
In that case you should check Qt bugtracker, but that could be because of security (especially wayland and xwayland) - key snooping IMO.

El Salvador

  • Full Member
  • ***
  • Posts: 134
Re: QT6 and new stuff
« Reply #16 on: November 28, 2022, 10:50:12 am »
Nope. For reference, I'm using QHotkey (https://github.com/Skycoder42/QHotkey) and it works everywhere. This lib uses xdg and get display from QNativeInterface. Honestly I don't think display can affect that much. As soon as I have time, I'll make another attempt with xlib-xdg (maybe something changed in the calls for x_grab_key?) and only xdg.

Quote
could be because of security (especially wayland and xwayland) - key snooping IMO.
Mmm... I'm using X11, so I guess it's more of a development error than a security issue. On wayland, we can use xdg-desktop-portal (it is fresh news https://www.youtube.com/watch?v=rfXP9gltk3A), but I highly doubt I'll have time to put myself to work on it. For me, it will already be a success to have this functionality on x11 (gtk2, gtk3, qt5 and qt6) out of the box.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #17 on: November 28, 2022, 02:00:14 pm »
Qt6 is still fresh lib, maybe it's bug in bindings, but Qt6 have a lot of bugs atm, so problem can be anywhere.

El Salvador

  • Full Member
  • ***
  • Posts: 134
Re: QT6 and new stuff
« Reply #18 on: November 30, 2022, 01:41:31 pm »
Oh my gosh. Today I discovered that QX11Info (https://www.qt.io/blog/qt-extras-modules-in-qt-6) still exists in qt6, but it has been moved to private header. In fact KGlobalAccel still uses it! https://github.com/KDE/kglobalaccel/blob/788890556134f3cb9cbfc1fa498b90f06ca0c779/src/runtime/plugins/xcb/kglobalaccel_x11.cpp#L21

So in my lib I reintroduced the QX11Info_display method to retrieve the display and... it works. Everywhere. But I really don't think it's a stable solution for the future. Using qt internals is a bad thing, imho.

However I don't understand the difference between XOpenDisplay() and QX11Info::display().

P.S.: I don't want to annoy you, but all my posts are for tracking for anyone who runs into the same problem as me.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #19 on: November 30, 2022, 04:02:51 pm »
I guess that QX11Info_display() is not XOpenDisplay() but xcb_connection, so that makes difference.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #20 on: December 16, 2022, 03:43:39 pm »
New Qt6 CBindings version is commited. I've added QGuiApplication_x11Display() and QGuiApplication_xcbConnection(), now our app and Qt uses same descriptor for Display, so you don't need to use private stuff from Qt. Bindings version is 6.2.3.
Note for future versions: in Qt6-6.5 there will be QNativeInterface::WaylandApplication, I'll add it to our 6.2 based bindings but via versioning in source, so if Qt6 version >= 6.5 we'll be able to use wayland struct members, so our bindings will be 6.2 compatibile and returned wayland stuff will be nil for Qt6 < 6.5.

El Salvador

  • Full Member
  • ***
  • Posts: 134
Re: QT6 and new stuff
« Reply #21 on: December 16, 2022, 03:50:49 pm »
Great news! I will test it later. I will let you know. Meanwhile, thank you!

El Salvador

  • Full Member
  • ***
  • Posts: 134
Re: QT6 and new stuff
« Reply #22 on: December 17, 2022, 12:23:11 am »
Great. It works. In the coming days, I will make a patch to introduce hook methods in qt5/qt6 cbindings.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #23 on: December 17, 2022, 08:57:37 am »
Glad to hear that  :D

El Salvador

  • Full Member
  • ***
  • Posts: 134
Re: QT6 and new stuff
« Reply #24 on: December 21, 2022, 03:07:06 pm »

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT6 and new stuff
« Reply #25 on: December 21, 2022, 03:21:50 pm »
Just follow my notes on merge request. Qt5Pas.pro version should be changed, also QT_VERSION_CHECK since this is for qt5 only.
Later, all hook files can be copied to qt6/cbindings/src, and added to qt6/Qt6Pas.pro and merged to qt6 too.

 

TinyPortal © 2005-2018