[issue24889] Idle: always start with focus

2015-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 741b033c5290 by Terry Jan Reedy in branch '2.7':
Issue #24889: When starting Idle, force focus onto Idle window if not already
https://hg.python.org/cpython/rev/741b033c5290

New changeset d7449bac2c6d by Terry Jan Reedy in branch '3.4':
Issue #24889: When starting Idle, force focus onto Idle window if not already
https://hg.python.org/cpython/rev/d7449bac2c6d

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24889] Idle: always start with focus

2015-09-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the research and verification that this is harmless. It has been a 
daily annoyance.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24889] Idle: always start with focus

2015-08-19 Thread Mark Roseman

Mark Roseman added the comment:

I reproduced your problem on Windows, and verified that it wasn't an issue on 
either Mac or Linux.

Your fix however, didn't change anything for me (on a Windows 7 VM). I tried a 
few other things (raising the window, playing with various wm attributes, etc.) 
with no luck.

The fact that it works ok when run directly from the command prompt got me 
thinking, and I eventually tracked down what is preventing IDLE from becoming 
the front application.

It's actually an internal Windows feature, that's designed to prevent 
background applications from all of a sudden putting up windows that interfere 
with what you're doing in the foreground, instead putting a notification in the 
task bar and making you click that or the window itself.

The mechanism used is to prevent applications from coming to the front on their 
own if they don't do so very shortly after they're first launched. So when you 
launch a Python shell (e.g. from a command prompt), the delay it takes you to 
type import idlelib.idle plus the launch time exceeds this timeout, and 
Windows decides it won't allow it to put the window in the foreground.

You can change the timeout (or set it to 0 to disable the feature) via the 
registry key HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout
(you need to restart after). With that change, your fix worked for me.

You can Google around for ForegroundLockTimeout for additional info.

There's not realistically an easy way to get around it in IDLE itself (for 
obvious reasons, given the purpose of the feature).

I'm guessing this will affect few people as much as it does you, constantly 
starting and stopping IDLE from within Python. If the fix works on your system, 
especially without mucking with that registry key, that should cover it. The 
fix doesn't cause any harm on Mac or Linux.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24889
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24889] Idle: always start with focus

2015-08-18 Thread Terry J. Reedy

New submission from Terry J. Reedy:

On Windows, starting Idle with an icon or at console brings up shell or editor 
window with focus, ready to receive input. Starting Idle from a built python_d 
in interactive console mode with ' import idlelib.idle' brings up an Idle 
shell with a cursor blinking at the ' ' prompt, but leaves the input focus 
with the console until one clicks on the Shell window.  This is quite annoying 
and I want to fix it.

I have the impression that this may be a Windows-only problem.  True?

PyShell.main calls PyShellFileList.open_shell, which calls PyShell.begin. I 
believe this is the only place .begin is called, and it is only called when 
there is no existing Shell.

Calling text.focus_force() works for me.  .focus_set does not as the issue is 
application focus rather than widget focus within Idle.  Does this or might 
this cause any problems with Linux or Mac?

--
Side note: any comment on this line in the context?
 tkinter._default_root = None # 03Jan04 KBK What's this?

--
assignee: terry.reedy
components: IDLE
files: idle-focus-fix.diff
keywords: patch
messages: 248790
nosy: markroseman, serhiy.storchaka, terry.reedy
priority: high
severity: normal
stage: commit review
status: open
title: Idle: always start with focus
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40207/idle-focus-fix.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24889
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com