1
/*****************************************************************
3
Copyright (c) 2000-2001 Matthias Elter <elter@kde.org>
4
Copyright (c) 2001 Richard Moore <rich@kde.org>
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
******************************************************************/
32
bool Task::updateDemandsAttentionState( WId w )
37
QString Task::className() const
42
QString Task::classClass() const
49
bool on_current = d->info.isOnCurrentDesktop();
53
KWindowSystem::setCurrentDesktop(d->info.desktop());
54
KWindowSystem::forceActiveWindow(d->win);
57
if (d->info.isMinimized())
59
KWindowSystem::unminimizeWindow(d->win);
62
QRect geom = d->info.geometry();
63
QCursor::setPos(geom.center());
69
bool on_current = d->info.isOnCurrentDesktop();
73
KWindowSystem::setCurrentDesktop(d->info.desktop());
74
KWindowSystem::forceActiveWindow(d->win);
77
if (d->info.isMinimized())
79
KWindowSystem::unminimizeWindow(d->win);
82
QRect geom = d->info.geometry();
83
QCursor::setPos(geom.bottomRight());
86
void Task::setMaximized(bool maximize)
88
KWindowInfo info = KWindowSystem::windowInfo(d->win, NET::WMState | NET::XAWMState | NET::WMDesktop);
89
bool on_current = info.isOnCurrentDesktop();
93
KWindowSystem::setCurrentDesktop(info.desktop());
96
if (info.isMinimized())
98
KWindowSystem::unminimizeWindow(d->win);
103
KWindowSystem::forceActiveWindow(d->win);
109
KWindowInfo info = KWindowSystem::windowInfo(d->win, NET::WMState | NET::XAWMState | NET::WMDesktop);
110
bool on_current = info.isOnCurrentDesktop();
114
KWindowSystem::setCurrentDesktop(info.desktop());
117
if( info.isMinimized())
119
KWindowSystem::unminimizeWindow(d->win);
124
KWindowSystem::forceActiveWindow( d->win );
130
PostMessage( d->win, WM_CLOSE, 0, 0 );
133
void Task::toDesktop(int desk)
135
if (desk == KWindowSystem::currentDesktop()) {
136
KWindowSystem::forceActiveWindow(d->win);
140
void Task::setAlwaysOnTop(bool stay)
145
void Task::setKeptBelowOthers(bool below)
150
void Task::setFullScreen(bool fullscreen)
152
Q_UNUSED(fullscreen);
155
void Task::setShaded(bool shade)
160
void Task::publishIconGeometry(QRect rect)
162
if (rect == d->iconGeometry)
167
d->iconGeometry = rect;
170
void Task::refreshActivities()
175
} // TaskManager namespace