Callback toggle whether the window should hide when it loses
        focus. Called by the accel key.
436626
def accel_toggle_hide_on_lose_focus(self, *args):
        
        if self.settings.general.get_boolean('window-losefocus'):
            self.settings.general.set_boolean('window-losefocus', False)
        else:
            self.settings.general.set_boolean('window-losefocus', True)
        return True
608450
def _leave_event_hide(self):
        
        if (self.hide_timer_on and not self._hide_timer.isActive() and
            # If Enter events always came after Leave events, we wouldn't need
            # this check. But on Mac OS, it sometimes happens the other way
            # around when the tooltip is created.
            self.app.topLevelAt(QCursor.pos()) != self):
            self._hide_timer.start(800, self)
1027829
def on_key(self, event):
        """"""

        if self.main_window.grid.actions.pasting and \
           event.GetKeyCode() == wx.WXK_ESCAPE:
            self.aborted = True

        event.Skip()
31249
def visibility_changed(self, enable):
        
        if self.dockwidget is None:
            return
        if enable:
            self.dockwidget.raise_()
            widget = self.get_focus_widget()
            if widget is not None and self.undocked_window is not None:
                widget.setFocus()
        visible = self.dockwidget.isVisible() or self.ismaximized
        if self.DISABLE_ACTIONS_WHEN_HIDDEN:
            toggle_actions(self.plugin_actions, visible)
        self.isvisible = enable and visible
        if self.isvisible:
            self.refresh_plugin()
840729
def focusOutEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(PageControlWidget, self).focusOutEvent(event)
214840
function watchFocus() {
  var _blurred = false;
  window.addEventListener('focus', function() {
    if (_blurred) {
      _blurred = false;
      // startAnimating();
      // controls.freeze = false;
    }
  });
  window.addEventListener('blur', function() {
    // stopAnimating();
    _blurred = true;
    controls.freeze = true;
  });
}
924440
def toggleCollapseBefore( self ):
        
        if ( self.isCollapsed() ):
            self.uncollapse()
        else:
            self.collapse( XSplitterHandle.CollapseDirection.Before )
797666
def focusOutEvent(self, ev):
        """"""
        Kittens.widgets.ClickableTreeWidget.focusOutEvent(self, ev)
        # if focus is going to a child of ours, do nothing
        wid = QApplication.focusWidget()
        while wid:
            if wid is self:
                return
            wid = wid.parent()
        # else we're truly losing focus -- stop the editor
        self._startOrStopEditing()
1105642
def on_focusout(self, event, a):
		
		if event.widget.get() == '':
			event.widget.insert(0, default_text[a])
			event.widget.config(fg = 'grey')
812471
function abortControlsAutoHide( viewer ) {
    var i;
    viewer.controlsShouldFade = false;
    for ( i = viewer.controls.length - 1; i >= 0; i-- ) {
        viewer.controls[ i ].setOpacity( 1.0 );
    }
}
226854
function (e) {
			this._cancelCheckSelection();
			if (this._ignoreEvent(e)) { return; }
			if (util.isFirefox < 13 && e.which === 1) {
				this._clientDiv.contentEditable = false;
				(this._overlayDiv || this._clientDiv).draggable = true;
				this._ignoreBlur = true;
			}
			
			/* Prevent clicks outside of the client div from taking focus away. */
			var topNode = this._overlayDiv || this._clientDiv;
			/* Use view div on IE 8 otherwise it is not possible to scroll. */
			if (util.isIE < 9) { topNode = this._viewDiv; }
			var temp = e.target ? e.target : e.srcElement;
			while (temp) {
				if (topNode === temp) {
					return;
				}
				if (temp.className && temp.className.indexOf("textViewFind") !== -1) { //$NON-NLS-1$
					return;
				}
				temp = temp.parentNode;
			}
			if (e.preventDefault) { e.preventDefault(); }
			if (e.stopPropagation){ e.stopPropagation(); }
			if (!this._isW3CEvents) {
				/*
				* In IE 8 is not possible to prevent the default handler from running
				* during mouse down event using usual API. The workaround is to give
				* focus back to the client div.
				*/ 
				var that = this;
				var win = this._getWindow();
				win.setTimeout(function() {
					that._clientDiv.focus();
				}, 0);
			}
		}
981829
def OnMainToolbarToggle(self, event):
        """"""

        self.main_window.main_toolbar.SetGripperVisible(True)
        main_toolbar_info = \
            self.main_window._mgr.GetPane("main_window_toolbar")

        self._toggle_pane(main_toolbar_info)

        event.Skip()
448952
def focusOutEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(ControlWidget, self).focusOutEvent(event)
192001
def close_window(self):
        """"""
        if self.undocked_window is not None:
            self.undocked_window.close()
            self.undocked_window = None

            # Oddly, these actions can appear disabled after the Dock
            # action is pressed
            self.undock_action.setDisabled(False)
            self.close_plugin_action.setDisabled(False)
1323124
protected boolean activateAndFocusWindow(Stage window) {
        if (!window.isFocused()) {
            if (!window.isShowing()) {
                LOGGER.trace("cannot activate and focus the window '" + window.getTitle() + "' cause its window is not showing");
                return false;
            }
            LOGGER.trace("try to activate and focus the window  '" + window.getTitle() + "' cause its window is not focused");
            StageFocusedListener stageFocusedListener = new StageFocusedListener(window);
            window.focusedProperty().addListener(stageFocusedListener);

            PlatformImpl.runAndWait(() -> {
                window.toFront();
                window.requestFocus();
            });

            boolean windowFocused = stageFocusedListener.waitUntilWindowFocused();
            window.focusedProperty().removeListener(stageFocusedListener);
            LOGGER.trace("window focused ? " + windowFocused);
            if (!window.isFocused()) {
                LOGGER.warn("The window activation/focus process failed!!!");
                return false;
            }
            LOGGER.trace("The window activation/focus process is completed!!!");
        } else {
            LOGGER.trace("the window '" + window.getTitle() + "' is already focused");
        }
        return true;
    }
787597
public void toggleFocus(boolean focusOn) {

        if (focusOn) {
            addStyleName(formCss().focused());
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_help) || m_hasError) {
                if (shouldDisplayTooltipAbove()) {
                    addStyleName(formCss().displayAbove());
                } else {
                    removeStyleName(formCss().displayAbove());
                }
            } else {
                m_helpBubble.getStyle().setDisplay(Display.NONE);
            }
        } else {
            removeStyleName(formCss().focused());
            if (m_widget != null) {
                if (m_handler.hasSingleOptionalValue()) {
                    if (m_handler.getWidgetService().shouldRemoveLastValueAfterUnfocus(m_widget)) {
                        m_handler.removeAttributeValue(this);
                    }

                }
            }
        }
    }
1002204
function(setFocus) {
		var node = this.activeNode;
		if( node ) {
			this.activeNode = null; // Force re-activating
			node.setActive();
			if( setFocus ){
				node.setFocus();
			}
		}
	}