|
Krita Source Code Documentation
|
Background: For some reason, when using a combination of 'grabKeyboard' and 'releaseKeyboard' (e.g. the screen color sampling facility), the active window loses focus, or at least that is indicated by the change on the windows decorations (title bar, frame, etc.). Actually, the window seems to remain activated/focused regardless of the change on the window decorations. This is probably some bug on Qt/Plasma/X11 (a small and simple standalone test app gives the same results). More...
#include <KisGrabKeyboardFocusRecoveryWorkaround.h>
Classes | |
| class | Private |
Public Member Functions | |
| void | recoverFocus () |
Static Public Member Functions | |
| static KisGrabKeyboardFocusRecoveryWorkaround * | instance () |
Private Member Functions | |
| KisGrabKeyboardFocusRecoveryWorkaround () | |
Private Attributes | |
| QScopedPointer< Private > | m_d |
Background: For some reason, when using a combination of 'grabKeyboard' and 'releaseKeyboard' (e.g. the screen color sampling facility), the active window loses focus, or at least that is indicated by the change on the windows decorations (title bar, frame, etc.). Actually, the window seems to remain activated/focused regardless of the change on the window decorations. This is probably some bug on Qt/Plasma/X11 (a small and simple standalone test app gives the same results).
Workaround: This class uses a dummy top-level widget that is shown and closed immediately. This activates the dummy widget and then the previous window is reactivated, effectively restoring the focused look.
Usage: Use 'KisGrabKeyboardFocusRecoveryWorkaround::instance()->recoverFocus() when using a 'grabKeyboard'/'releaseKeyboard' if the top window seems to lose focus. Put that line right before 'releaseKeyboard' to prevent window decorations flickering.
Definition at line 34 of file KisGrabKeyboardFocusRecoveryWorkaround.h.
|
private |
Definition at line 28 of file KisGrabKeyboardFocusRecoveryWorkaround.cpp.
|
static |
Definition at line 32 of file KisGrabKeyboardFocusRecoveryWorkaround.cpp.
References KisGrabKeyboardFocusRecoveryWorkaround().
| void KisGrabKeyboardFocusRecoveryWorkaround::recoverFocus | ( | ) |
Definition at line 41 of file KisGrabKeyboardFocusRecoveryWorkaround.cpp.
References m_d.
|
private |
Definition at line 43 of file KisGrabKeyboardFocusRecoveryWorkaround.h.