Robust modal activation; ensure showing activated
...window REVIEW: 123875 BUG: 348083
This commit is contained in:
parent
f696b578cc
commit
41be18e317
5 changed files with 14 additions and 5 deletions
|
@ -217,6 +217,8 @@ public:
|
|||
virtual bool isCloseable() const = 0;
|
||||
// TODO: remove boolean trap
|
||||
virtual bool isShown(bool shaded_is_shown) const = 0;
|
||||
// TODO: remove boolean trap
|
||||
virtual void hideClient(bool hide) = 0;
|
||||
virtual bool isFullScreenable() const = 0;
|
||||
virtual bool isFullScreen() const = 0;
|
||||
// TODO: remove boolean trap
|
||||
|
|
|
@ -311,6 +311,9 @@ void Workspace::activateClient(AbstractClient* c, bool force)
|
|||
if (c->isMinimized())
|
||||
c->unminimize();
|
||||
|
||||
// ensure the window is really visible - could eg. be a hidden utility window, see bug #348083
|
||||
c->hideClient(false);
|
||||
|
||||
// TODO force should perhaps allow this only if the window already contains the mouse
|
||||
if (options->focusPolicyIsReasonable() || force)
|
||||
requestFocus(c, force);
|
||||
|
@ -354,11 +357,10 @@ void Workspace::takeActivity(AbstractClient* c, ActivityFlags flags)
|
|||
if (flags & ActivityFocus) {
|
||||
AbstractClient* modal = c->findModal();
|
||||
if (modal != NULL && modal != c) {
|
||||
if (!modal->isOnDesktop(c->desktop())) {
|
||||
if (!modal->isOnDesktop(c->desktop()))
|
||||
modal->setDesktop(c->desktop());
|
||||
if (modal->desktop() != c->desktop()) // forced desktop
|
||||
activateClient(modal);
|
||||
}
|
||||
if (!modal->isShown(true) && !modal->isMinimized()) // forced desktop or utility window
|
||||
activateClient(modal); // activating a minimized blocked window will unminimize its modal implicitly
|
||||
// if the click was inside the window (i.e. handled is set),
|
||||
// but it has a modal, there's no need to use handled mode, because
|
||||
// the modal doesn't get the click anyway
|
||||
|
|
2
client.h
2
client.h
|
@ -356,7 +356,7 @@ public:
|
|||
/// Updates visibility depending on being shaded, virtual desktop, etc.
|
||||
void updateVisibility();
|
||||
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
|
||||
void hideClient(bool hide);
|
||||
void hideClient(bool hide) override;
|
||||
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
|
||||
|
||||
virtual bool setupCompositing();
|
||||
|
|
|
@ -296,6 +296,10 @@ bool ShellClient::isShown(bool shaded_is_shown) const
|
|||
return !m_closing && !m_unmapped;
|
||||
}
|
||||
|
||||
void ShellClient::hideClient(bool hide)
|
||||
{
|
||||
}
|
||||
|
||||
void ShellClient::maximize(MaximizeMode mode)
|
||||
{
|
||||
if (m_maximizeMode == mode) {
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
bool isMovableAcrossScreens() const override;
|
||||
bool isResizable() const override;
|
||||
bool isShown(bool shaded_is_shown) const override;
|
||||
void hideClient(bool hide) override;
|
||||
void maximize(MaximizeMode) override;
|
||||
MaximizeMode maximizeMode() const override;
|
||||
bool noBorder() const override;
|
||||
|
|
Loading…
Reference in a new issue