Tk Source Code

View Ticket
Login
Ticket UUID: 3138512
Title: Tk applicatications after grab command (both local/global mo
Type: Bug Version: None
Submitter: akurbatov Created on: 2010-12-16 09:46:13
Subsystem: 56. [grab] Assigned To: oehhar
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-09-28 09:21:08
Resolution: Fixed Closed By: oehhar
    Closed on: 2026-09-28 09:21:08
Description:
XP SP2,XP SP3,..,Win7 32-64bit
Tk 8.5.9 ,8.6.0 (but not 8.4.*)

1) start any application, for example: notepad.exe
2) start ..>Demos>TK 
     Miscellaneous > 2. A dialog box with a local grab. 
3) click on Task_Manager/Show_Desktop button
4) click on Task_Manager/notepad.exe icon (or any others Task_Manager icons)

Oops.. (Tk application minimized forever)

Bug #3009450 ?
User Comments: oehhar added on 2026-09-28 09:21:08:

Thanks. Here is my test case:

toplevel .t
pack [button .t.b -text close -command {destroy .t}]
grab -global .t
  • Start wish and enter test code
  • Press Win+D
  • try to restore the window labeled "t" from the task bar (not wishxx) -> it stays minimized.

Merged to branches:

  • main: [3f517077]
  • core-9-0-branch: problem not present (no idea why)

Anyway, thanks for all, Harald


serhiy.storchaka added on 2026-09-25 10:21:17:

The local grab case was fixed by [b86736bbf7] ([ed6c3a787d]). With grab -global it still fails on Windows 11 with 8.6.18 and 9.1: the mouse capture held by the global grab prevents Windows from restoring the minimized window.

Proposed fix in [ba25235ae7] (branch win-global-grab-restore): release the capture on SC_RESTORE; Tk sets it again on the next pointer event. New test winWm-9.3 fails without the fix.