View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0015648||Lazarus||LCL||public||2010-02-02 03:21||2010-03-09 09:45|
|Reporter||cobines||Assigned To||Paul Ishenin|
|Product Version||0.9.29 (SVN)|
|Fixed in Version||0.9.29 (SVN)|
|Summary||0015648: Application is not properly deactivated|
|Description||The Application.OnActivate and Application.OnDeactivate events are not called on Win32 and Linux-QT4. Only the first OnActivate (after the application has started) is received. While they are working on Linux-Gtk2 I think this is LCL issue not the widgetsets. |
Both on Win32 and QT widgetsets the activate/deactivate messages from OS are detected and TApplication.Activate and TApplication.Deactivate functions are being called. What is stopping the OnActivate, OnDeactive events from working is that the application is never deactivated. In the following code
procedure TApplication.Deactivate(Data: PtrInt);
if (AppDestroying in FFlags) then exit;
if (not (AppActive in FFlags)) then exit;
if (FindControl(GetFocus)<>nil) then begin
// another control of this application has got the focus
the "if (FindControl(GetFocus)<>nil)" condition stops the message from affecting application state. It so happens that on GTK2 this condition is always false (maybe when the application is deactivated its controls also lose focus) - that's why it works. On Win32 and QT there usually is a control with focus so it doesn't work.
I think the application can be active even if no control has focus. It also can be deactivated when a control has focus. Therefore I think this condition should be removed.
|Tags||No tags attached.|
|Fixed in Revision||23884|
||My patch is already here http://bugs.freepascal.org/view.php?id=15331 and wait to be commited.Please test with that patch and give some feedback.|
Yes, your patch is exactly what I meant. I have tested on Win32, Linux/GTK2, and Linux/QT and application activation/deactivation is working. Focus is properly restored too.
The difference between the widgetsets is that Win32 and QT send on deactivate:
- Deactivate app
- Kill focus
But GTK2 sends:
- Kill focus
- Deactivate app
So it is always working on GTK2, and never on Win32 and QT.
If the patch gets committed I think this issue can be resolved.
Yes, win32 & qt works as expected, don't know for gtk2, but if something's wrong with gtk2 that's because that it's still common gtk1 code.
Again: if ws sends app deactivate then app is deactivated.Everything else is wrong (like it is now in LCL).
Was the patch applied? I still see the buggy behavior in Win32.
I have an issue registered regarding Gtk2 behavior; it triggers Deactivate on every form switch.
||No it's not applied yet.|
||Please test and close if ok.|
||It's ok now. Thanks.|
|2010-02-02 03:21||cobines||New Issue|
|2010-02-02 03:21||cobines||Widgetset||=> Win32/Win64, QT|
|2010-02-02 08:05||Zeljan Rikalo||Relationship added||related to 0015331|
|2010-02-02 08:06||Zeljan Rikalo||LazTarget||=> -|
|2010-02-02 08:06||Zeljan Rikalo||Note Added: 0034150|
|2010-02-02 08:06||Zeljan Rikalo||Status||new => feedback|
|2010-02-02 08:07||Zeljan Rikalo||Relationship added||related to 0015340|
|2010-02-02 23:50||cobines||Note Added: 0034170|
|2010-02-03 08:05||Zeljan Rikalo||Note Added: 0034182|
|2010-02-28 05:47||Flávio Etrusco||Note Added: 0034843|
|2010-02-28 09:17||Zeljan Rikalo||Note Added: 0034844|
|2010-03-09 09:14||Paul Ishenin||Fixed in Revision||=> 23884|
|2010-03-09 09:14||Paul Ishenin||Status||feedback => resolved|
|2010-03-09 09:14||Paul Ishenin||Fixed in Version||=> 0.9.29 (SVN)|
|2010-03-09 09:14||Paul Ishenin||Resolution||open => fixed|
|2010-03-09 09:14||Paul Ishenin||Assigned To||=> Paul Ishenin|
|2010-03-09 09:14||Paul Ishenin||Note Added: 0035061|
|2010-03-09 09:45||Zeljan Rikalo||Status||resolved => closed|
|2010-03-09 09:45||Zeljan Rikalo||Note Added: 0035062|