Tk Source Code

Ticket Change Details
Login
Overview

Artifact ID: ae8ce8454eea09c1bd7087f1b6e4f0e3b9c3359384a05f9e2c2b2a8018b48505
Ticket: e02aac5cab6a9a1c8f6a27582ec21dd356ee601b
Grab documentation does not have caveats for windows & mac
User & Date: fvogel 2018-07-09 20:37:30
Changes

  1. comment changed to:
    Grab does not work as described when running under windows 7 x64. In response to my question about grab on comp.lang.tcl, it was stated that it also would not work as described on mac's either. 
    
    Exactly how grab works on windows & macs should be described in the man page for grab.
    
    This was the TCL ticket here [http://core.tcl.tk/tcl/info/4915cf6c4f704430].
    
    The discussion on comp.lang.tcl that originally prompted this ticket is [https://groups.google.com/d/msg/comp.lang.tcl/jRF7NwcURp4/J_lme2tYAQAJ]
    
  2. icomment:
    From what I gather in [https://groups.google.com/d/msg/comp.lang.tcl/jRF7NwcURp4/J_lme2tYAQAJ|that c.l.t. discussion]:
    
      - global grabs never work on Windows and macOS. grab will force focus on the requested window within the Tk application but has no effect on other windows
    
      - global grabs may not work on Linux either since the wm or desktop preferences can reject it
    
    Moreover, what I see in the test suite output on macOS is that requests for local grabs are always transformed into global grabs on this platorm, which can rather easily be seen [https://core.tcl.tk/tk/artifact/309e74311e0c3368?ln=429,433|in the source code].
    
    For the records, here is the output when exercising grab.test with current core-8-6-branch on macOS (the failures are all due to the local --> global silent switch in the source code):
    
    <verbatim>
    ==== grab-2.2 Tk_GrabObjCmd, grab status gives correct status FAILED
    ==== Contents of test case:
    
        set curr [grab current .]
        if { [string length $curr] > 0 } {
    	grab release $curr
        }
        grab .
        grab status .
    
    ---- Result was:
    global
    ---- Result should have been (exact matching):
    local
    ==== grab-2.2 FAILED
    
    
    
    ==== grab-4.1 Tk_GrabObjCmd, grab release releases grab FAILED
    ==== Contents of test case:
    
        set curr [grab current .]
        if { [string length $curr] > 0 } {
    	grab release $curr
        }
        grab .
        set result [grab status .]
        grab release .
        lappend result [grab status .]
        grab -global .
        lappend result [grab status .]
        grab release .
        lappend result [grab status .]
    
    ---- Result was:
    global none global none
    ---- Result should have been (exact matching):
    local none global none
    ==== grab-4.1 FAILED
    
    
    
    ==== grab-5.1 Tk_GrabObjCmd, grab set FAILED
    ==== Contents of test case:
    
        set curr [grab current .]
        if { [string length $curr] > 0 } {
    	grab release $curr
        }
        grab set .
        list [grab current .] [grab status .]
    
    ---- Result was:
    . global
    ---- Result should have been (exact matching):
    . local
    ==== grab-5.1 FAILED
    </verbatim>
    
  3. login: "fvogel"
  4. mimetype: "text/x-fossil-wiki"