~ubuntu-branches/ubuntu/vivid/lazarus/vivid-proposed

« back to all changes in this revision

Viewing changes to lcl/interfaces/gtk2/gtk2widgetset.inc

  • Committer: Package Import Robot
  • Author(s): Abou Al Montacir
  • Date: 2014-05-15 23:17:51 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140515231751-gumj9a01g0ghm7ac
Tags: 1.2.2+dfsg-1
* New upstream release with few fixes and official support of FPC 2.6.4.
  - The detailed list of changes can be found here:
  http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.2_.28Merged.29

Show diffs side-by-side

added added

removed removed

Lines of Context:
4459
4459
  if Valid then Result := {%H-}HWND(gdk_window_foreign_new(ResultWindow));
4460
4460
end;
4461
4461
 
 
4462
function TGtk2WidgetSet.GetAlwaysOnTopX11(AWindow: PGdkWindow): boolean;
 
4463
var
 
4464
  Display: PDisplay;
 
4465
  X11Window: TWindow;
 
4466
  WMAtom: TAtom;
 
4467
  typeReturned: TAtom;
 
4468
  formatReturned: Integer;
 
4469
  nitemsReturned: PtrInt;
 
4470
  unused: PtrInt;
 
4471
  data: Pointer;
 
4472
begin
 
4473
  Result := False;
 
4474
  Display := gdk_x11_get_default_xdisplay;
 
4475
  if Display = nil then
 
4476
    exit;
 
4477
  X11Window := gdk_x11_drawable_get_xid(PGdkDrawable(AWindow));
 
4478
  if X11Window = 0 then
 
4479
    exit;
 
4480
  WMAtom := XInternAtom(Display,'_NET_WM_STATE', False);
 
4481
  if WMAtom > 0 then
 
4482
  begin
 
4483
    data := nil;
 
4484
    if XGetWindowProperty(Display, X11Window, WMAtom, 0, 1024, False, XA_ATOM,
 
4485
      @typeReturned, @formatReturned, @nitemsReturned,
 
4486
      @unused, @data) = Success then
 
4487
    begin
 
4488
      if (typeReturned = XA_ATOM) and (formatReturned = 32) and
 
4489
        (Data <> nil) then
 
4490
      begin
 
4491
        while nitemsReturned > 0 do
 
4492
        begin
 
4493
          // make happy ancient x11 or old kde ?
 
4494
          if XInternAtom(Display,'_NET_WM_STATE_STAYS_ON_TOP', False) = TAtom(Data^) then
 
4495
            Result := True
 
4496
          else
 
4497
          if XInternAtom(Display,'_NET_WM_STATE_ABOVE', False) = TAtom(Data^) then
 
4498
            Result := True;
 
4499
          dec(nItemsReturned);
 
4500
          if Result or (nItemsReturned = 0) then
 
4501
            break;
 
4502
          inc(Data);
 
4503
        end;
 
4504
        XFree(Data);
 
4505
        Data := nil;
 
4506
      end;
 
4507
    end;
 
4508
  end;
 
4509
end;
 
4510
 
4462
4511
procedure TGtk2WidgetSet.HideAllHints;
4463
4512
var
4464
4513
  TopList, List: PGList;