mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 13:18:29 +02:00
MG: made mouse capturing more strict
git-svn-id: trunk@2139 -
This commit is contained in:
parent
2bcf2ca00e
commit
7e33b812c4
@ -589,7 +589,12 @@ begin
|
|||||||
EventTrace('destroy', data);
|
EventTrace('destroy', data);
|
||||||
Mess.msg := LM_DESTROY;
|
Mess.msg := LM_DESTROY;
|
||||||
Result := DeliverMessage(Data, Mess) = 0;
|
Result := DeliverMessage(Data, Mess) = 0;
|
||||||
if longint(widget)=MCaptureHandle then Uncapturehandle;
|
|
||||||
|
// This is a safety check, when the normal destruction fails because of bugs,
|
||||||
|
// ! A wrong mouse capture can freeze X !
|
||||||
|
if (MCaptureHandle<>0)
|
||||||
|
and (GetLCLObject(widget)=GetLCLObject(Pointer(MCaptureHandle))) then
|
||||||
|
Uncapturehandle;
|
||||||
|
|
||||||
// NOTE: if the destroy message is posted
|
// NOTE: if the destroy message is posted
|
||||||
// we should post an info destroy message as well
|
// we should post an info destroy message as well
|
||||||
@ -603,7 +608,12 @@ begin
|
|||||||
Mess.Msg:= LM_CLOSEQUERY;
|
Mess.Msg:= LM_CLOSEQUERY;
|
||||||
{ Message results : True - do nothing, False - destroy or hide window }
|
{ Message results : True - do nothing, False - destroy or hide window }
|
||||||
Result:= DeliverMessage(Data, Mess) = 0;
|
Result:= DeliverMessage(Data, Mess) = 0;
|
||||||
if longint(widget)=MCaptureHandle then Uncapturehandle;
|
|
||||||
|
// This is a safety check, when the normal destruction fails because of bugs,
|
||||||
|
// ! A wrong mouse capture can freeze X !
|
||||||
|
if (MCaptureHandle<>0)
|
||||||
|
and (GetLCLObject(widget)=GetLCLObject(Pointer(MCaptureHandle))) then
|
||||||
|
Uncapturehandle;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1289,7 +1299,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
theDialog := TCommonDialog(data);
|
theDialog := TCommonDialog(data);
|
||||||
FPointer := Pointer(theDialog.Handle);
|
FPointer := Pointer(theDialog.Handle);
|
||||||
// gtk_grab_remove(PgtkWidget(TCommonDialog(data).Handle));
|
|
||||||
if theDialog is TFileDialog then
|
if theDialog is TFileDialog then
|
||||||
begin
|
begin
|
||||||
if theDialog is TOpenDialog then
|
if theDialog is TOpenDialog then
|
||||||
@ -1380,7 +1390,6 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
theDialog := TCommonDialog(data);
|
theDialog := TCommonDialog(data);
|
||||||
// gtk_grab_remove(PgtkWidget(TCommonDialog(data).Handle));
|
|
||||||
if theDialog is TFileDialog then
|
if theDialog is TFileDialog then
|
||||||
begin
|
begin
|
||||||
TFileDialog(data).FileName := '';
|
TFileDialog(data).FileName := '';
|
||||||
@ -1427,7 +1436,6 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
theDialog := TCommonDialog(data);
|
theDialog := TCommonDialog(data);
|
||||||
// gtk_grab_remove(PgtkWidget(TCommonDialog(data).Handle));
|
|
||||||
if (theDialog is TFontDialog)
|
if (theDialog is TFontDialog)
|
||||||
and (fdApplyButton in TFontDialog(theDialog).Options)
|
and (fdApplyButton in TFontDialog(theDialog).Options)
|
||||||
and (Assigned(TFontDialog(theDialog).OnApplyClicked)) then begin
|
and (Assigned(TFontDialog(theDialog).OnApplyClicked)) then begin
|
||||||
@ -2505,6 +2513,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.149 2002/10/17 15:09:31 lazarus
|
||||||
|
MG: made mouse capturing more strict
|
||||||
|
|
||||||
Revision 1.148 2002/10/15 16:01:36 lazarus
|
Revision 1.148 2002/10/15 16:01:36 lazarus
|
||||||
MG: fixed timers
|
MG: fixed timers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user