Skip to content

Commit

Permalink
Make the default for the "enter_focus" property to be False
Browse files Browse the repository at this point in the history
- viewer windows will not steal the focus if the mouse moves across them
  • Loading branch information
ejeschke committed Aug 22, 2024
1 parent 51b9de4 commit cd0c4bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/WhatsNew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Ver 5.2.0 (unreleased)
- Fixed an issue with the mouse wheel event scrolling MDI workspaces
- Fixed a spurious warning when moving the cursor in the Pan plugin
window and a table or plot viewer is running in the channel
- Made the enter_focus property default to False

- Viewer windows will not steal the keyboard focus if the mouse moves
over them


Ver 5.1.0 (2024-05-22)
======================
Expand Down
4 changes: 4 additions & 0 deletions ginga/qtw/Widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1965,10 +1965,14 @@ def __init__(self, parent, child, title='', iconpath=None):
if iconpath is None:
iconpath = app_icon_path
w.setWindowIcon(QIcon(iconpath))
#w.setFocusPolicy(QtCore.Qt.StrongFocus)
self.widget = w

child_w = child.get_widget()
# what size does the widget want to be?
wd, ht = child_w.width(), child_w.height()
w.setWidget(child_w)
w.resize(wd, ht)

# NOTE: we fire the page-switch callback by intercepting the
# focus event on the subwindow, rather than off of the
Expand Down
2 changes: 1 addition & 1 deletion ginga/rv/Control.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ def build_viewpane(self, settings, rgbmap=None, size=(1, 1)):
# check general settings for default value of enter_focus
enter_focus = settings.get('enter_focus', None)
if enter_focus is None:
enter_focus = self.settings.get('enter_focus', True)
enter_focus = self.settings.get('enter_focus', False)
fi.set_enter_focus(enter_focus)
# check general settings for default value of focus indicator
focus_ind = settings.get('show_focus_indicator', None)
Expand Down

0 comments on commit cd0c4bc

Please sign in to comment.