Ticket #154: libview_fix_1_of_2_rev_00b6d158ab89_Issue__154__Set___NET_WM_WINDOW_TYPE__property_according_to_desired__windowStyle_.patch

File libview_fix_1_of_2_rev_00b6d158ab89_Issue__154__Set___NET_WM_WINDOW_TYPE__property_according_to_desired__windowStyle_.patch, 1.8 KB (added by jan vrany, 7 years ago)
  • XWorkstation.st

    # HG changeset patch
    # User Jan Vrany <jan.vrany@fit.cvut.cz>
    # Date 1500450340 -7200
    #      Wed Jul 19 09:45:40 2017 +0200
    # Branch jv
    # Node ID 00b6d158ab892165b66856fc9062ae5f4744f5f6
    # Parent  e3d9945d5d9fa95f869ec9bd427488843c19e185
    Issue #154: Set `_NET_WM_WINDOW_TYPE` property according to desired "windowStyle"
    
    Note, that `wStyle` value is some Smalltalk/X abstraction
    of window types across all supported platforms (modeled,
    presumably, after Winsows) so there;s no 1:1 match. The code
    code below tries to do it's best.
    /
    See Extended Window Manager Hints 1.3
        http://standards.freedesktop.org/wm-spec/1.3/
    
        XWorkstation >> setWindowType:in:
    
    See https://swing.fit.cvut.cz/projects/stx-jv/ticket/154
    
    diff -r e3d9945d5d9f -r 00b6d158ab89 XWorkstation.st
    a b  
    25622562    windowId = __MKEXTERNALADDRESS(newWindow);
    25632563%}.
    25642564
     2565    "/ Set EWMH `_NET_WM_WINDOW_TYPE` property on created window
     2566    "/ depending on desired `wStyle`.
     2567    "/
     2568    "/ Note, that `wStyle` value is some Smalltalk/X abstraction
     2569    "/ of window types across all supported platforms (modeled,
     2570    "/ presumably, after Winsows) so there;s no 1:1 match. The code
     2571    "/ code below tries to do it's best.
     2572    "/
     2573    "/ See Extended Window Manager Hints 1.3
     2574    "/     http://standards.freedesktop.org/wm-spec/1.3/
     2575    "/   
     2576    "/     XWorkstation >> setWindowType:in:
     2577    "/
     2578    (wStyle == #dialog or:[wStyle == #dialog2]) ifTrue:[
     2579        self setWindowType: #'_NET_WM_WINDOW_TYPE_DIALOG' in: windowId.
     2580    ] ifFalse:[
     2581    (wStyle == #toolWindow) ifTrue:[
     2582        self setWindowType: #'_NET_WM_WINDOW_TYPE_UTILITY' in: windowId.
     2583    ]].
     2584
    25652585"/    (wStyle ~= nil and:[wStyle ~= #normal]) ifTrue:[
    25662586"/        self setWindowType:wStyle in:windowId.
    25672587"/    ].