qt and transient windows

Dizzutch
Cat in the hat
Cat in the hat
Posts: 43
Joined: Mon Aug 15, 2005 6:57 pm
Location: Worcester, MA
Contact:

qt and transient windows

Postby Dizzutch » Tue Nov 21, 2006 4:42 pm

All,
I recently installed kregexpeditor and when loading it, i noticed that the window is set as Transient, thus not showing up in my IconMan, nor having window decorations. I added

Code: Select all

Style kregexpeditor DecorateTransient
to my config temporarily, but do not see the need of this window being transient. I'd prefer to write a patch for my gentoo overlay to remove the transient property of this window. Can anybody with QT experience give me some direction as to what function to look for in the code to disable this transient property?

Thanks!

-Dizz

thomasadam
Administrator
Administrator
Posts: 3043
Joined: Mon Nov 08, 2004 1:12 am
Location: England
Contact:

Re: qt and transient windows

Postby thomasadam » Tue Nov 21, 2006 9:12 pm

Dizzutch wrote:All,
I recently installed kregexpeditor and when loading it, i noticed that the window is set as Transient, thus not showing up in my IconMan, nor having window decorations. I added

Code: Select all

Style kregexpeditor DecorateTransient
to my config temporarily, but do not see the need of this window being transient. I'd prefer to write a patch for my gentoo overlay to remove the transient property of this window. Can anybody with QT experience give me some direction as to what function to look for in the code to disable this transient property?

Thanks!

-Dizz


There's two separate issues going on here. To explain the FVWM side of things, you can probably force what you're doing to "fake" the fact that it's transient, but assigning more buttons to it:

Code: Select all

Style kregexpeditor Button 1, Button 2, [...]


If, however, the main window application is registering as being modal (transient), that is indeed a bug. Just re-confirm it using the following:

Code: Select all

xprop | grep -i transient


... and then click on this application (I have no idea what it does -- nor care). You should see output similar to:

Code: Select all

WM_TRANSIENT_FOR(WINDOW): window id # 0x5200003


In which case the developers of this thing want shooting. I don't have any idea what's happening without looking at the source code. However I'll quote to you verbatim a snippet of an email I sent to someone some months ago now. From that, I'll let you dig around:

an email wrote:Recognising the need for transient window is important. Having a full-blown
window is overkill in terms of Xlib operations, when really, they're only
on-screen for very short periods of time. Moreover, because they're the
responsibility of the parent application, the inherent modality to the
specific window, is often welcomed.

At the Xlib level, XSetTransientForHint() is called by whatever wrapper
function a specific widget set is calling. This sets the WM_TRANSIENT_FOR
XAtom on the window, that the WM can then recognise.

As to how they're implemented. In QT (via C++) there's both
types -- modal and non-modal. Via the QDialog class, modal
dialogs in this instance block access to the parent window
until they're closed. This is probably what you want in terms
of a transient window. Here's an example:

void Editor::find()
{
WordCountDialog dialog(this);
dialog.setWordCount(document().wordCount());
dialog.exec();
}

What's the important thing here is the exec() method call. This is what
defines the dialog as a modal window.

Non-modal windows are things like search/replace windows whereby both have to
be interacted with (the parent and the transient window). In much the same
way as the above code example, here's one for non-modal:

void Editor::find()
{
WordCountDialog dialog(this);
dialog.setWordCount(document().wordCount());
dialog.show();
dialog.raise();
dialog.activeWindow();
}

... again, it's show() that determines non-modality.


-- Thomas Adam

Dizzutch
Cat in the hat
Cat in the hat
Posts: 43
Joined: Mon Aug 15, 2005 6:57 pm
Location: Worcester, MA
Contact:

Postby Dizzutch » Tue Nov 21, 2006 9:51 pm

thanks thomasadam,
the window is indeed modal

Code: Select all

jule@leiden ~ $ xprop | grep -i transient
WM_TRANSIENT_FOR(WINDOW): window id # 0x4c

I will file a bug with the development team, but since my previous bug reports for this application have yet to be replied upon, I decided to try and fix it myself.
-Dizzutch

Roms1984
Kitten
Kitten
Posts: 7
Joined: Sat Aug 08, 2015 8:49 am

Re: qt and transient windows

Postby Roms1984 » Sat Nov 28, 2015 10:35 am

what function to look for in the code to disable this transient property?
gclub download


Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 1 guest