qt - Carbon, LSUIElement, and showing a window -


I have a carbon LSUIElement application that runs in the background (possibly with the icon in the menu bar, depending on the pref) And sometimes the user needs to show a dialogue - sometimes a user responds to the incident, but sometimes in response to the failure or similarity of some background work.

(I am using QT 4.5, so the application will be Coco based with Carbon based Qt 4.6 things, but it seems that the problem can also be present there).

The problem is that when I open a window, and show it, it is not on the front I think that it is an artefect of having an LSUIElement app.

To work around the problem, I tried to go directly to the window server: (For this, uses QT Carbon in SelectWindow, and in Cocoa [makeKeyAndOrderFront]. Window ID is to be obtained, it will be easy with QT-coco, because I can use NSWindow: NativeVindo)

  WindowRef Ref = HIVGetWindow ((HIVIIFF) aWidget-> WinId) ); CGSWindow wid = GetNativeWindowFromWindowRef (ref); CGSConnection cid = _CGSDefaultConnection (); CGS order window (CID, with, 1 / * everything up * /, 0 / * zero * /);  

This works, like - the window appears, but it is not highlighted or is centered on the keyboard, are there additional steps to fix those issues, Is there a simple solution to the problem?

Use SetFrontProcessWith the option to bring your window in front of other windows.


Comments