Recent

Author Topic: Bring window of another application on top of all other application windows  (Read 4091 times)

Ricco42

  • Guest
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.

Code: Pascal  [Select][+][-]
  1. [...]
  2. uses
  3.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  4.   xlib, x, ctypes, DateUtils;
  5. [...]
  6.  
  7. procedure TForm1.Button4Click(Sender: TObject);
  8. var display: PDisplay;
  9.     fenster: TWindow;
  10.     root:TWindow;
  11.     standard_bildschirm:cint;
  12.     myevent:TXEvent;
  13. begin
  14.  fenster:=$36000fc;
  15.  
  16.  display := XOpenDisplay(nil);
  17.  if (display = nil) then ShowMessage('Display Zugriff fehlgeschlagen :(');
  18.  
  19.  standard_bildschirm:=DefaultScreen(display);
  20.  
  21.  root:=RootWindow(display,standard_bildschirm);
  22.  
  23.  myevent._type:=ClientMessage;
  24.  myevent.xclient.message_type:=XInternAtom(display,'_NET_ACTIVE_WINDOW',false);
  25.  myevent.xclient.window:=fenster;
  26.  myevent.xclient.format:=32;
  27.  
  28.  XSendEvent(display,
  29.             root,
  30.             False,
  31.             VisibilityChangeMask
  32.             OR StructureNotifyMask
  33.             OR SubstructureRedirectMask
  34.             OR FocusChangeMask
  35.             OR PropertyChangeMask,
  36.             @myevent);
  37.  
  38.  XMapWindow(display,fenster);
  39.  
  40.  XFlush(display);
  41.  
  42.  XCloseDisplay(display);
  43.  
  44. end;
  45.  


Ricco42

  • Guest
Can be closed. Moved the post to » Programming » Operating Systems » Linux .

 

TinyPortal © 2005-2018