Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread mirabilos
On Fri, 20 Nov 2020, Volker Hilsheimer wrote:

> In Qt 6 there is no more Qt API to get the X11 root window for a
> display (also note that QDesktopWidget as a whole is gone).
> 
> So, you either have to go native if you rely on X11 specific data

But I’m not even using anything X11-specific… in fact, this should
be portable. Both QDesktopWidget and KWallet APIs are that at least.

I’m not nearly versed enough in either C++ or Qt to comment, so
could you (as in, Qt project) please take this up with the KDE
upstream developers which I assume you have a good relationship
with?

I’m “just” trying to access the KDE wallet.

Thanks,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread Thiago Macieira
On Thursday, 19 November 2020 18:42:18 PST mirabilos wrote:
> > If the application is run non-interactively and possibly
> > without GUI, then it doesn't have access window IDs.
> 
> It does run with a GUI, but the only UI elements it has are those
> rendered by the kwallet service (things like the unlock prompt);
> it requires a GUI display even if itself only uses stdio and command
> line arguments.

Please ask that KWallet support applications without UI and thus having no 
window IDs to provide.

Passing the root winow ID, which is not yours, is wrong.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread Richard Moore
Digging back through the code, I can see that the XCB platform plugin
ensures that the Display * and the xcb_connection correspond to the same
display by opening them together using the same string (in Qt 5). Assuming
the same is done in the Qt 6 plugin then exposing them again through
QX11Info would be just the same as in Qt 5.

Cheers

Rich

On Fri, 20 Nov 2020 at 14:18, Giuseppe D'Angelo via Interest <
interest@qt-project.org> wrote:

> Il 20/11/20 14:55, Richard Moore ha scritto:
> > I'd hope there's a way to get the actual connection being used, rather
> > than relying on looking at the environment variables. For example, what
> > happens if -display is passed?
>
> As in QX11Info::connection()?
>
> Thanks,
> --
> Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread Giuseppe D'Angelo via Interest

Il 20/11/20 14:55, Richard Moore ha scritto:
I'd hope there's a way to get the actual connection being used, rather 
than relying on looking at the environment variables. For example, what 
happens if -display is passed?


As in QX11Info::connection()?

Thanks,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: Firma crittografica S/MIME
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread Tor Arne Vestbø


On 20 Nov 2020, at 14:55, Richard Moore mailto:r...@kde.org>> 
wrote:



On Fri, 20 Nov 2020 at 07:58, Volker Hilsheimer 
mailto:volker.hilshei...@qt.io>> wrote:
In Qt 6 there is no more Qt API to get the X11 root window for a display (also 
note that QDesktopWidget as a whole is gone).

So, you either have to go native if you rely on X11 specific data structures 
(which the code does anyway, in verifying that there is a DISPLAY environment 
variable), or pass a pointer to (or index of) a QScreen if you want to place a 
UI on a specific display.

I'd hope there's a way to get the actual connection being used, rather than 
relying on looking at the environment variables. For example, what happens if 
-display is passed?

Not at the moment, as XCB doesn’t expose that. Xlib does, but only if the 
connection was created using Xlib. An API to expose whatever Qt decides to use 
based on parsing DISPLAY or -display, like we have in QX11Extras, is being 
considered, but won’t be in 6.0. Ideally XCB would expose this, so we don’t 
need to add workarounds in Qt.

Cheers,
Tor Arne

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-20 Thread Richard Moore
On Fri, 20 Nov 2020 at 07:58, Volker Hilsheimer 
wrote:

> In Qt 6 there is no more Qt API to get the X11 root window for a display
> (also note that QDesktopWidget as a whole is gone).
>
> So, you either have to go native if you rely on X11 specific data
> structures (which the code does anyway, in verifying that there is a
> DISPLAY environment variable), or pass a pointer to (or index of) a QScreen
> if you want to place a UI on a specific display.


I'd hope there's a way to get the actual connection being used, rather than
relying on looking at the environment variables. For example, what happens
if -display is passed?

Cheers

Rich
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-19 Thread Volker Hilsheimer
> On 20 Nov 2020, at 03:42, mirabilos  wrote:
> 
> On Thu, 19 Nov 2020, Thiago Macieira wrote:
> 
>> Then pass nothing.
> 
> That reportedly causes problems with kwallet.
> 
>> If the application is run non-interactively and possibly 
>> without GUI, then it doesn't have access window IDs.
> 
> It does run with a GUI, but the only UI elements it has are those
> rendered by the kwallet service (things like the unlock prompt);
> it requires a GUI display even if itself only uses stdio and command
> line arguments.
> 
>> What application are you launching? Because KWallet is a D-Bus service and 
>> kwalletmanager doesn't require window IDs.
> 
> http://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/code/kwalletcli/kwif5.cc?rev=1.2
> 
> Search for openWallet there.
> 
> The window ID was added by the person who ported this to KDE 5;
> apparently, this is necessary now.
> 
> Thanks,
> //mirabilos


In Qt 6 there is no more Qt API to get the X11 root window for a display (also 
note that QDesktopWidget as a whole is gone).

So, you either have to go native if you rely on X11 specific data structures 
(which the code does anyway, in verifying that there is a DISPLAY environment 
variable), or pass a pointer to (or index of) a QScreen if you want to place a 
UI on a specific display.


Volker

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-19 Thread mirabilos
On Thu, 19 Nov 2020, Thiago Macieira wrote:

> Then pass nothing.

That reportedly causes problems with kwallet.

> If the application is run non-interactively and possibly 
> without GUI, then it doesn't have access window IDs.

It does run with a GUI, but the only UI elements it has are those
rendered by the kwallet service (things like the unlock prompt);
it requires a GUI display even if itself only uses stdio and command
line arguments.

> What application are you launching? Because KWallet is a D-Bus service and 
> kwalletmanager doesn't require window IDs.

http://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/code/kwalletcli/kwif5.cc?rev=1.2

Search for openWallet there.

The window ID was added by the person who ported this to KDE 5;
apparently, this is necessary now.

Thanks,
//mirabilos
-- 
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
be a database”  (#nosec)‣‣‣ Please let MySQL and MariaDB finally die!
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Window ID of the current screen (root window)?

2020-11-19 Thread Thiago Macieira
On Thursday, 19 November 2020 15:08:32 PST mirabilos wrote:
> Background: a valid window ID is needed to open the KDE Wallet,
> and since this is about a command-line program there’s no widget
> I could ask for its window ID. The program is run in terminal or
> even nōn-interactively (from session startup files or gpg-agent).

Then pass nothing. If the application is run non-interactively and possibly 
without GUI, then it doesn't have access window IDs.

What application are you launching? Because KWallet is a D-Bus service and 
kwalletmanager doesn't require window IDs.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Window ID of the current screen (root window)?

2020-11-19 Thread mirabilos
Hi,

apparently, using…

QApplication::desktop()->screen()->winId()

… is deprecated, but what can I use to replace this?

Background: a valid window ID is needed to open the KDE Wallet,
and since this is about a command-line program there’s no widget
I could ask for its window ID. The program is run in terminal or
even nōn-interactively (from session startup files or gpg-agent).

The current code works, it just gives me a deprecation warning
on QApplication::desktop()->screen() already.

Thanks in advance,
//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.   -- Rob Pike in "Notes on Programming in C"
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest