{"thread":{"id":"16311","subject":"[RFC PATCH (GIT-GUI)] git-gui: Increase blame viewer usability on MacOS.","startedAt":"2008-11-13T19:02:09Z","lastAt":"2008-11-13T19:02:09Z","messageCount":1,"participants":["Alexander Gavrilov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95710","messageId":"200811132202.09139.angavrilov@gmail.com","threadId":"16311","inReplyTo":null,"subject":"[RFC PATCH (GIT-GUI)] git-gui: Increase blame viewer usability on MacOS.","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-11-13T19:02:09Z","receivedAt":"2008-11-13T19:02:09Z","isPatch":true,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"On MacOS raising a window causes the focus to be transferred\nto it -- although it may actually be a bug in the Tcl/Tk port.\nWhen this happens with the blame viewer tooltips, it makes\nthe interface less usable, because Entry and Leave handlers\non the text view cause the tip to disappear once the mouse\nis moved even 1 pixel.\n\nThis commit makes the code raise the main window on MacOS\nwhen Tk 8.5 is used. This version seems to properly support\nwm transient by making the tip stay on top of the master,\nso reraising the master does not cause it to disappear. Thus\nthe only remaining sign of problems is slight UI flicker\nwhen focus is momentarily transferred to the tip and back.\n\nSigned-off-by: Alexander Gavrilov <angavrilov@gmail.com>\n---\n\n\tAn ugly hack, but it makes at least my experience better.\n\tUnfortunately, even it requires manually installing Tk 8.5.\n\n\tI wonder if there is a better fix.\n\t(maybe, tweaking Enter and Leave instead?)\n\n\tAlexander\n\n lib/blame.tcl |   16 +++++++++++++++-\n 1 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/lib/blame.tcl b/lib/blame.tcl\nindex c1cd7f3..f086a8a 100644\n--- a/lib/blame.tcl\n+++ b/lib/blame.tcl\n@@ -1246,6 +1246,18 @@ method _open_tooltip {cur_w} {\n \n \t$tooltip_t conf -state disabled\n \t_position_tooltip $this\n+\n+\t# On MacOS raising a window causes it to acquire focus.\n+\t# Tk 8.5 on MacOS seems to properly support wm transient,\n+\t# so we can safely counter the effect there.\n+\tif {$::have_tk85 && [tk windowingsystem] eq {aqua}} {\n+\t\tupdate\n+\t\tif {$w eq {}} {\n+\t\t\traise .\n+\t\t} else {\n+\t\t\traise $w\n+\t\t}\n+\t}\n }\n \n method _position_tooltip {} {\n@@ -1269,7 +1281,9 @@ method _position_tooltip {} {\n \tappend g $pos_y\n \n \twm geometry $tooltip_wm $g\n-\traise $tooltip_wm\n+\tif {[tk windowingsystem] ne {aqua}} {\n+\t\traise $tooltip_wm\n+\t}\n }\n \n method _hide_tooltip {} {\n-- \n1.6.0.3.15.gb8d36\n"}]}