{"thread":{"id":"16766","subject":"[PATCH] gitk: force focus to main window","startedAt":"2008-12-17T11:50:09Z","lastAt":"2008-12-18T07:30:49Z","messageCount":6,"participants":["Johannes Sixt","Paul Mackerras","Johannes Schindelin","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"98125","messageId":"4948E771.4050705@viscovery.net","threadId":"16766","inReplyTo":null,"subject":"[PATCH] gitk: force focus to main window","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-12-17T11:50:09Z","receivedAt":"2008-12-17T11:50:09Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nOn msysGit, the focus is first on the (Tk) console.  This console is then\nhidden, but keeps the focus.  Work around that by forcing the focus onto\nthe gitk window.\n\nThis fixes issue 14.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n gitk-git/gitk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 1c8d98e..b3d8219 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -10898,4 +10898,5 @@ if {[info exists permviews]} {\n \taddviewmenu $n\n     }\n }\n+focus -force .\n getcommits {}\n-- \n1.6.1.rc3.980.ga0bb\n"},{"id":"98197","messageId":"18761.29020.237388.687560@cargo.ozlabs.ibm.com","threadId":"16766","inReplyTo":"4948E771.4050705@viscovery.net","subject":"Re: [PATCH] gitk: force focus to main window","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-12-17T21:38:36Z","receivedAt":"2008-12-17T21:38:36Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Johannes Sixt writes:\n\n> On msysGit, the focus is first on the (Tk) console.  This console is then\n> hidden, but keeps the focus.  Work around that by forcing the focus onto\n> the gitk window.\n\nHmmm, I don't like doing focus -force unconditionally on all\nplatforms.  I hate it when applications decide they know best and\noverride what the window manager decides.\n\nAt least put a if {[tk windowingsystem] eq \"win32\"} in there.\n(msysGit is a windows thing, isn't it?)\n\nPaul.\n"},{"id":"98216","messageId":"alpine.DEB.1.00.0812180413240.14632@racer","threadId":"16766","inReplyTo":"18761.29020.237388.687560@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: force focus to main window","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-12-18T03:14:25Z","receivedAt":"2008-12-18T03:14:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 18 Dec 2008, Paul Mackerras wrote:\n\n> Johannes Sixt writes:\n> \n> > On msysGit, the focus is first on the (Tk) console.  This console is \n> > then hidden, but keeps the focus.  Work around that by forcing the \n> > focus onto the gitk window.\n> \n> Hmmm, I don't like doing focus -force unconditionally on all platforms.  \n> I hate it when applications decide they know best and override what the \n> window manager decides.\n\n>From my previous experience with my patches to gitk, I did not expect \notherwise.  That is why I did not even bother with this one.\n\n> At least put a if {[tk windowingsystem] eq \"win32\"} in there. (msysGit \n> is a windows thing, isn't it?)\n\nYeah, because on other platforms, when you start gitk, you don't want it \nto take focus.  Yeah, right.\n\nCiao,\nDscho\n"},{"id":"98220","messageId":"20081218032358.GB20749@coredump.intra.peff.net","threadId":"16766","inReplyTo":"alpine.DEB.1.00.0812180413240.14632@racer","subject":"Re: [PATCH] gitk: force focus to main window","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-18T03:23:58Z","receivedAt":"2008-12-18T03:23:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Dec 18, 2008 at 04:14:25AM +0100, Johannes Schindelin wrote:\n\n> > At least put a if {[tk windowingsystem] eq \"win32\"} in there. (msysGit \n> > is a windows thing, isn't it?)\n> \n> Yeah, because on other platforms, when you start gitk, you don't want it \n> to take focus.  Yeah, right.\n\nThat is _exactly_ what I want on my platform: no window should steal the\nfocus when I am in the middle of typing in some other window. And to\nthat end, my window manager does not shift the focus until I tell it to\ndo so.\n\nSo yes, this patch _does_ break at least my setup. But more importantly,\nit is an application making a decision about focus policy that should be\nmade by the window manager. I understand that the window manager in\nWindows sucks, and that this is a workaround that makes things better\nthere. But please don't inflict this braindeadedness on the rest of us.\n\n-Peff\n"},{"id":"98223","messageId":"18761.52488.206887.985268@cargo.ozlabs.ibm.com","threadId":"16766","inReplyTo":"alpine.DEB.1.00.0812180413240.14632@racer","subject":"Re: [PATCH] gitk: force focus to main window","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-12-18T04:09:44Z","receivedAt":"2008-12-18T04:09:44Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Johannes Schindelin writes:\n\n> > At least put a if {[tk windowingsystem] eq \"win32\"} in there. (msysGit \n> > is a windows thing, isn't it?)\n> \n> Yeah, because on other platforms, when you start gitk, you don't want it \n> to take focus.  Yeah, right.\n\nNo - on other platforms I have a window manager that gives focus to\nnew applications automatically.  Or, if I don't want new applications\nto grab the focus, I tell the window manager that that's what the\npolicy should be.  Either way the application shouldn't forcibly and\nunilaterally grab the focus.\n\nI'm prepared (predisposed, even :-) to believe that windows sucks, so\nI'll take the patch if it only affects windows.\n\nPaul.\n"},{"id":"98234","messageId":"4949FC29.2080200@viscovery.net","threadId":"16766","inReplyTo":"18761.29020.237388.687560@cargo.ozlabs.ibm.com","subject":"[PATCH v2] gitk: force the focus to the main window on Windows","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-12-18T07:30:49Z","receivedAt":"2008-12-18T07:30:49Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nOn msysGit, the focus is first on the (Tk) console.  This console is then\nhidden, but keeps the focus.  Work around that by forcing the focus onto\nthe gitk window.\n\nThis fixes msysGit issue 14. Diagnosed and originally fixed by\nJohannes Schindelin.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\nPaul Mackerras schrieb:\n> At least put a if {[tk windowingsystem] eq \"win32\"} in there.\n> (msysGit is a windows thing, isn't it?)\n\nI did that.\n\n-- Hannes\n\n gitk |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex b63109b..121b621 100644\n--- a/gitk\n+++ b/gitk\n@@ -10898,4 +10898,9 @@ if {[info exists permviews]} {\n \taddviewmenu $n\n     }\n }\n+\n+if {[tk windowingsystem] eq \"win32\"} {\n+    focus -force .\n+}\n+\n getcommits {}\n-- \n1.6.1.rc3.950.g5dd2\n"}]}