Hi guys,
I try to bring a specific window of another application on top of all other application windows if I press a button in my application.
My OS is Ubuntu 20.04.3 LTS.
My code highlights the other application in the Bottom Panel and if it was minimized it restores the window but it is not on top of all other application windows.
[...]
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
xlib, x, ctypes, DateUtils;
[...]
procedure TForm1.Button4Click(Sender: TObject);
var display: PDisplay;
fenster: TWindow;
root:TWindow;
standard_bildschirm:cint;
myevent:TXEvent;
begin
fenster:=$36000fc;
display := XOpenDisplay(nil);
if (display = nil) then ShowMessage('Display Zugriff fehlgeschlagen :(');
standard_bildschirm:=DefaultScreen(display);
root:=RootWindow(display,standard_bildschirm);
myevent._type:=ClientMessage;
myevent.xclient.message_type:=XInternAtom(display,'_NET_ACTIVE_WINDOW',false);
myevent.xclient.window:=fenster;
myevent.xclient.format:=32;
XSendEvent(display,
root,
False,
VisibilityChangeMask
OR StructureNotifyMask
OR SubstructureRedirectMask
OR FocusChangeMask
OR PropertyChangeMask,
@myevent);
XMapWindow(display,fenster);
XFlush(display);
XCloseDisplay(display);
end;