All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitk: force focus to main window
@ 2008-12-17 11:50 Johannes Sixt
  2008-12-17 21:38 ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Sixt @ 2008-12-17 11:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Git Mailing List, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

On msysGit, the focus is first on the (Tk) console.  This console is then
hidden, but keeps the focus.  Work around that by forcing the focus onto
the gitk window.

This fixes issue 14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 gitk-git/gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1c8d98e..b3d8219 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -10898,4 +10898,5 @@ if {[info exists permviews]} {
 	addviewmenu $n
     }
 }
+focus -force .
 getcommits {}
-- 
1.6.1.rc3.980.ga0bb

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gitk: force focus to main window
  2008-12-17 11:50 [PATCH] gitk: force focus to main window Johannes Sixt
@ 2008-12-17 21:38 ` Paul Mackerras
  2008-12-18  3:14   ` Johannes Schindelin
  2008-12-18  7:30   ` [PATCH v2] gitk: force the focus to the main window on Windows Johannes Sixt
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Mackerras @ 2008-12-17 21:38 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git Mailing List, Johannes Schindelin

Johannes Sixt writes:

> On msysGit, the focus is first on the (Tk) console.  This console is then
> hidden, but keeps the focus.  Work around that by forcing the focus onto
> the gitk window.

Hmmm, I don't like doing focus -force unconditionally on all
platforms.  I hate it when applications decide they know best and
override what the window manager decides.

At least put a if {[tk windowingsystem] eq "win32"} in there.
(msysGit is a windows thing, isn't it?)

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gitk: force focus to main window
  2008-12-17 21:38 ` Paul Mackerras
@ 2008-12-18  3:14   ` Johannes Schindelin
  2008-12-18  3:23     ` Jeff King
  2008-12-18  4:09     ` Paul Mackerras
  2008-12-18  7:30   ` [PATCH v2] gitk: force the focus to the main window on Windows Johannes Sixt
  1 sibling, 2 replies; 6+ messages in thread
From: Johannes Schindelin @ 2008-12-18  3:14 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Johannes Sixt, Git Mailing List

Hi,

On Thu, 18 Dec 2008, Paul Mackerras wrote:

> Johannes Sixt writes:
> 
> > On msysGit, the focus is first on the (Tk) console.  This console is 
> > then hidden, but keeps the focus.  Work around that by forcing the 
> > focus onto the gitk window.
> 
> Hmmm, I don't like doing focus -force unconditionally on all platforms.  
> I hate it when applications decide they know best and override what the 
> window manager decides.

>From my previous experience with my patches to gitk, I did not expect 
otherwise.  That is why I did not even bother with this one.

> At least put a if {[tk windowingsystem] eq "win32"} in there. (msysGit 
> is a windows thing, isn't it?)

Yeah, because on other platforms, when you start gitk, you don't want it 
to take focus.  Yeah, right.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gitk: force focus to main window
  2008-12-18  3:14   ` Johannes Schindelin
@ 2008-12-18  3:23     ` Jeff King
  2008-12-18  4:09     ` Paul Mackerras
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff King @ 2008-12-18  3:23 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Paul Mackerras, Johannes Sixt, Git Mailing List

On Thu, Dec 18, 2008 at 04:14:25AM +0100, Johannes Schindelin wrote:

> > At least put a if {[tk windowingsystem] eq "win32"} in there. (msysGit 
> > is a windows thing, isn't it?)
> 
> Yeah, because on other platforms, when you start gitk, you don't want it 
> to take focus.  Yeah, right.

That is _exactly_ what I want on my platform: no window should steal the
focus when I am in the middle of typing in some other window. And to
that end, my window manager does not shift the focus until I tell it to
do so.

So yes, this patch _does_ break at least my setup. But more importantly,
it is an application making a decision about focus policy that should be
made by the window manager. I understand that the window manager in
Windows sucks, and that this is a workaround that makes things better
there. But please don't inflict this braindeadedness on the rest of us.

-Peff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gitk: force focus to main window
  2008-12-18  3:14   ` Johannes Schindelin
  2008-12-18  3:23     ` Jeff King
@ 2008-12-18  4:09     ` Paul Mackerras
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2008-12-18  4:09 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Sixt, Git Mailing List

Johannes Schindelin writes:

> > At least put a if {[tk windowingsystem] eq "win32"} in there. (msysGit 
> > is a windows thing, isn't it?)
> 
> Yeah, because on other platforms, when you start gitk, you don't want it 
> to take focus.  Yeah, right.

No - on other platforms I have a window manager that gives focus to
new applications automatically.  Or, if I don't want new applications
to grab the focus, I tell the window manager that that's what the
policy should be.  Either way the application shouldn't forcibly and
unilaterally grab the focus.

I'm prepared (predisposed, even :-) to believe that windows sucks, so
I'll take the patch if it only affects windows.

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] gitk: force the focus to the main window on Windows
  2008-12-17 21:38 ` Paul Mackerras
  2008-12-18  3:14   ` Johannes Schindelin
@ 2008-12-18  7:30   ` Johannes Sixt
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Sixt @ 2008-12-18  7:30 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Git Mailing List, Johannes Schindelin

From: Johannes Sixt <j6t@kdbg.org>

On msysGit, the focus is first on the (Tk) console.  This console is then
hidden, but keeps the focus.  Work around that by forcing the focus onto
the gitk window.

This fixes msysGit issue 14. Diagnosed and originally fixed by
Johannes Schindelin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Paul Mackerras schrieb:
> At least put a if {[tk windowingsystem] eq "win32"} in there.
> (msysGit is a windows thing, isn't it?)

I did that.

-- Hannes

 gitk |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index b63109b..121b621 100644
--- a/gitk
+++ b/gitk
@@ -10898,4 +10898,9 @@ if {[info exists permviews]} {
 	addviewmenu $n
     }
 }
+
+if {[tk windowingsystem] eq "win32"} {
+    focus -force .
+}
+
 getcommits {}
-- 
1.6.1.rc3.950.g5dd2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-18  7:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-17 11:50 [PATCH] gitk: force focus to main window Johannes Sixt
2008-12-17 21:38 ` Paul Mackerras
2008-12-18  3:14   ` Johannes Schindelin
2008-12-18  3:23     ` Jeff King
2008-12-18  4:09     ` Paul Mackerras
2008-12-18  7:30   ` [PATCH v2] gitk: force the focus to the main window on Windows Johannes Sixt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.