Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: revisit text highlighting for inactive windows on win32 #69160

Closed
roseman mannequin opened this issue Aug 31, 2015 · 8 comments
Closed

IDLE: revisit text highlighting for inactive windows on win32 #69160

roseman mannequin opened this issue Aug 31, 2015 · 8 comments
Assignees
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@roseman
Copy link
Mannequin

roseman mannequin commented Aug 31, 2015

BPO 24972
Nosy @loewis, @terryjreedy, @serwy, @roseman, @rovitotv
Files
  • inactiveselection.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2015-09-28.08:19:34.310>
    created_at = <Date 2015-08-31.18:54:20.971>
    labels = ['expert-IDLE', 'type-bug']
    title = 'IDLE: revisit text highlighting for inactive windows on win32'
    updated_at = <Date 2015-09-28.08:53:31.051>
    user = 'https://github.com/roseman'

    bugs.python.org fields:

    activity = <Date 2015-09-28.08:53:31.051>
    actor = 'python-dev'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2015-09-28.08:19:34.310>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2015-08-31.18:54:20.971>
    creator = 'markroseman'
    dependencies = []
    files = ['40396']
    hgrepos = []
    issue_num = 24972
    keywords = ['patch']
    message_count = 8.0
    messages = ['249422', '249807', '250122', '251679', '251745', '251747', '251754', '251755']
    nosy_count = 8.0
    nosy_names = ['loewis', 'terry.reedy', 'roger.serwy', 'markroseman', 'Todd.Rovito', 'python-dev', 'Rich.Rauenzahn', 'dzabel']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24972'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6']

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 31, 2015

    This is a followup to bpo-14146

    I don't think this is actually a Tk bug. The text widget supports an "inactiveselectbackground" option which controls the background color of the selection when the window is not active. On Win32, this is defined as empty (i.e. no highlighting).

    This option is new in Tk 8.5. I don't believe that Tk 8.4 displayed the selection differently for active and inactive windows, hence why the problem never showed up until 8.5.

    It seems that if running 8.5, setting this widget option to the desired color would then remove the need for the _highlight_workaround() in EditorWindow.py.

    Can someone else besides me try this out please?

    @roseman roseman mannequin added the topic-IDLE label Aug 31, 2015
    @terryjreedy
    Copy link
    Member

    Rather than copying the nosy list from an old issue, which likely contains people no longer interested, better to announce a followup on the old issue.

    I am not sure what you want me to try out. If it is a code change, please upload a patch. If it is a user action, please specify.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Sep 7, 2015

    See inactiveselection.patch. This addresses the original bug of the debugger not highlighting the correct line, and also various issues with the find windows not highlighting the selection they have found, e.g. bpo-22179, bpo-18590

    @terryjreedy
    Copy link
    Member

    I verified that inactiveselectbackground exists and starts as ''. Since it should match the active selectbackground on all systems, as set by the current theme. I will try adding a line where selection colors are set: EditorWindow.ResetColorizer:
    self.text.config(
    ...
    selectforeground=select_colors['foreground'],
    selectbackground=select_colors['background'],
    inactiveselectbackground=select_colors['background']
    )
    I believe this is the only place where this is needed. The select colors are used for a different widget in TreeWidget. The use in ParenMatch for 'paren' tag should be temporary.

    We will need to reconsider the 'found' highlight and the select versus found usage after this change.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 28, 2015

    New changeset 4b3356f1a261 by Terry Jan Reedy in branch '2.7':
    Issue bpo-24972: Inactive selection background now matches active selection
    https://hg.python.org/cpython/rev/4b3356f1a261

    New changeset 70c01dd35100 by Terry Jan Reedy in branch '3.4':
    Issue bpo-24972: Inactive selection background now matches active selection
    https://hg.python.org/cpython/rev/70c01dd35100

    @terryjreedy
    Copy link
    Member

    I first testing the workaround by selecting text and then clicking on another window, and the highlight stayed. I commented out "self._highlight_workaround()", quit, started again, tested again, and the highlight disappeared. I added the new line above, retested, and the hightlight stayed.

    Debugger source highlighting again does not work for me on Win7 in any installed or repository version, before or after the patch. See bpo-25254. The patch does immediately fix at least part of the find issue. I will review them later.

    While the report above implies that I committed to 3.4 and merged forward, there is a screw-up in the repository that prevented merging, so I backed out the 3.4 patch before pushing. So only 2.7 is patched and this issue is not done.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 28, 2015

    New changeset 2445750029df by Terry Jan Reedy in branch '3.4':
    Issue bpo-24972: Inactive selection background now matches active selection
    https://hg.python.org/cpython/rev/2445750029df

    @terryjreedy terryjreedy self-assigned this Sep 28, 2015
    @terryjreedy terryjreedy added the type-bug An unexpected behavior, bug, or error label Sep 28, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 28, 2015

    New changeset 45955adc2ed2 by Terry Jan Reedy in branch '2.7':
    Issue bpo-24972: New option is only valid in tk 8.5+.
    https://hg.python.org/cpython/rev/45955adc2ed2

    New changeset 460e6e6fb09a by Terry Jan Reedy in branch '3.4':
    Issue bpo-24972: New option is only valid in tk 8.5+.
    https://hg.python.org/cpython/rev/460e6e6fb09a

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant