mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 06:35:59 +02:00
gtk2 intf: disabled SIZEICONIC messages, because the gtk2 sends them too, when user switches to another desktop, and then the LCL hides the whole application
git-svn-id: trunk@9524 -
This commit is contained in:
parent
3c0b2f09e2
commit
fb6dfb5499
@ -1004,8 +1004,7 @@ end;
|
|||||||
|
|
||||||
{$IFDEF Gtk2}
|
{$IFDEF Gtk2}
|
||||||
function GTKWindowStateEventCB(widget: PGtkWidget;
|
function GTKWindowStateEventCB(widget: PGtkWidget;
|
||||||
state: PGdkEventWindowState;
|
state: PGdkEventWindowState; data: gpointer): gboolean; cdecl;
|
||||||
data: gpointer): gboolean; cdecl;
|
|
||||||
var
|
var
|
||||||
TheForm: TCustomForm;
|
TheForm: TCustomForm;
|
||||||
SizeMsg: TLMSize;
|
SizeMsg: TLMSize;
|
||||||
@ -1018,6 +1017,7 @@ begin
|
|||||||
|
|
||||||
if TObject(Data) is TCustomForm then begin
|
if TObject(Data) is TCustomForm then begin
|
||||||
TheForm := TCustomForm(Data);
|
TheForm := TCustomForm(Data);
|
||||||
|
DebugLn(['GTKWindowStateEventCB ',DbgSName(TheForm),' new_window_state=',state^.new_window_state,' changed_mask=',state^.changed_mask]);
|
||||||
if TheForm.Parent = nil then begin (* toplevel window, just as a sanity check *)
|
if TheForm.Parent = nil then begin (* toplevel window, just as a sanity check *)
|
||||||
if GTK_WIDGET_REALIZED(Widget) then begin
|
if GTK_WIDGET_REALIZED(Widget) then begin
|
||||||
// send a WMSize Message (see TCustomForm.WMSize)
|
// send a WMSize Message (see TCustomForm.WMSize)
|
||||||
@ -1025,9 +1025,13 @@ begin
|
|||||||
if GtkWidth<0 then GtkWidth:=0;
|
if GtkWidth<0 then GtkWidth:=0;
|
||||||
GtkHeight:=Widget^.Allocation.Height;
|
GtkHeight:=Widget^.Allocation.Height;
|
||||||
if GtkHeight<0 then GtkHeight:=0;
|
if GtkHeight<0 then GtkHeight:=0;
|
||||||
//debugln('GTKWindowStateEventCB ',DbgSName(TObject(Data)),' ',dbgs(state^.new_window_state));
|
debugln('GTKWindowStateEventCB ',DbgSName(TObject(Data)),' ',dbgs(state^.new_window_state),' ',WidgetFlagsToString(Widget));
|
||||||
if (GDK_WINDOW_STATE_ICONIFIED and state^.new_window_state)>0 then
|
if (GDK_WINDOW_STATE_ICONIFIED and state^.new_window_state)>0 then
|
||||||
SizeMsg.SizeType:=SIZEICONIC
|
// the window is iconified, or the user switched to another desktop
|
||||||
|
// TODO: find out which one happened.
|
||||||
|
// The LCL interprets SIZEICONIC as minimizing by the user
|
||||||
|
// and thus minimizes the whole application.
|
||||||
|
SizeMsg.SizeType:=SIZENORMAL //SIZEICONIC
|
||||||
else if (GDK_WINDOW_STATE_MAXIMIZED and state^.new_window_state)>0 then
|
else if (GDK_WINDOW_STATE_MAXIMIZED and state^.new_window_state)>0 then
|
||||||
SizeMsg.SizeType:=SIZEFULLSCREEN
|
SizeMsg.SizeType:=SIZEFULLSCREEN
|
||||||
else
|
else
|
||||||
|
@ -158,7 +158,7 @@ function GTKWindowStateEventCB(widget: PGtkWidget;
|
|||||||
data: gpointer): gboolean; cdecl;
|
data: gpointer): gboolean; cdecl;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{$IfNdef GTK2}
|
{$Ifdef GTK1}
|
||||||
function gtkDrawAfter(Widget: PGtkWidget; area: PGDKRectangle;
|
function gtkDrawAfter(Widget: PGtkWidget; area: PGDKRectangle;
|
||||||
data: gPointer): GBoolean; cdecl;
|
data: gPointer): GBoolean; cdecl;
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
</General>
|
</General>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
@ -41,6 +40,9 @@
|
|||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
|
<SearchPaths>
|
||||||
|
<LCLWidgetType Value="gtk2"/>
|
||||||
|
</SearchPaths>
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Checks>
|
<Checks>
|
||||||
<IOChecks Value="True"/>
|
<IOChecks Value="True"/>
|
||||||
|
@ -159,6 +159,7 @@ end;
|
|||||||
procedure TForm1.Form1MouseMove(Sender: TObject; Shift: TShiftState; X,
|
procedure TForm1.Form1MouseMove(Sender: TObject; Shift: TShiftState; X,
|
||||||
Y: Integer);
|
Y: Integer);
|
||||||
begin
|
begin
|
||||||
|
exit;
|
||||||
debugln('TForm1.Form1MouseMove ',DbgSName(Sender),
|
debugln('TForm1.Form1MouseMove ',DbgSName(Sender),
|
||||||
' X=',dbgs(X),' Y=',dbgs(Y),' Shift=',dbgs(Shift));
|
' X=',dbgs(X),' Y=',dbgs(Y),' Shift=',dbgs(Shift));
|
||||||
end;
|
end;
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
|
<SearchPaths>
|
||||||
|
<LCLWidgetType Value="gtk2"/>
|
||||||
|
</SearchPaths>
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Checks>
|
<Checks>
|
||||||
<IOChecks Value="True"/>
|
<IOChecks Value="True"/>
|
||||||
|
@ -256,7 +256,6 @@ begin
|
|||||||
OnUTF8KeyPress:=@FormUTF8KeyPress;
|
OnUTF8KeyPress:=@FormUTF8KeyPress;
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
|
|
||||||
DebugLn(['TForm1And2.Create AAA ',DbgSName(Form1),' ',DbgSName(Form2)]);
|
|
||||||
if Self=Form1 then
|
if Self=Form1 then
|
||||||
Name:='Form1'
|
Name:='Form1'
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user