mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:59:15 +02:00
gtk1 intf no longer moves a focused window to another desktop from Andrew Haines
git-svn-id: trunk@7006 -
This commit is contained in:
parent
f1efae7c04
commit
c0e9b1683c
@ -194,6 +194,7 @@ var
|
|||||||
{$IFDEF GTK1}
|
{$IFDEF GTK1}
|
||||||
FormWidget: PGtkWidget;
|
FormWidget: PGtkWidget;
|
||||||
FormWindow: PGdkWindowPrivate;
|
FormWindow: PGdkWindowPrivate;
|
||||||
|
WindowDesktop: Integer;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseFocus}
|
{$IFDEF VerboseFocus}
|
||||||
@ -219,15 +220,26 @@ begin
|
|||||||
{$IFDEF DebugGDKTraps}
|
{$IFDEF DebugGDKTraps}
|
||||||
EndGDKErrorTrap;
|
EndGDKErrorTrap;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// how to set the keyboard focus to the raised window?
|
|
||||||
{$IFDEF GTK1}
|
{$IFDEF GTK1}
|
||||||
FormWidget:=PGtkWidget(AForm.Handle);
|
FormWidget:=PGtkWidget(AForm.Handle);
|
||||||
FormWindow:=PGdkWindowPrivate(FormWidget^.window);
|
FormWindow:=PGdkWindowPrivate(FormWidget^.window);
|
||||||
if FormWindow<>nil then begin
|
if FormWindow<>nil then begin
|
||||||
GDK_WINDOW_ACTIVATE(FormWindow);
|
WindowDesktop := GDK_WINDOW_GET_DESKTOP(FormWindow);
|
||||||
|
// this prevents the window from appearing on a different desktop
|
||||||
|
// which could be undesirable.
|
||||||
|
|
||||||
|
// check if the window is on all desktops or is on the current desktop
|
||||||
|
if (WindowDesktop < 0) or (WindowDesktop = GDK_GET_CURRENT_DESKTOP) then begin
|
||||||
|
GDK_WINDOW_ACTIVATE(FormWindow);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
// TODO: Figure out how to set the focus on an inactive desktop without
|
||||||
|
// bringing the window to the current desktop
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ifdef gtk2}
|
{$ifdef gtk2}
|
||||||
|
// this currently will bring the window to the current desktop and focus it
|
||||||
gtk_window_present(PGtkWindow(hWnd));
|
gtk_window_present(PGtkWindow(hWnd));
|
||||||
{$endif gtk2}
|
{$endif gtk2}
|
||||||
end;
|
end;
|
||||||
@ -8985,6 +8997,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.418 2005/03/21 18:59:50 mattias
|
||||||
|
gtk1 intf no longer moves a focused window to another desktop from Andrew Haines
|
||||||
|
|
||||||
Revision 1.417 2005/03/21 08:12:10 mattias
|
Revision 1.417 2005/03/21 08:12:10 mattias
|
||||||
fixed removing focus of a gtk listbox on delete item from Collin Western
|
fixed removing focus of a gtk listbox on delete item from Collin Western
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user