It's really interesting that KWin has had support for an arbitrary root
window, but I don't think it really works these days, and it's probably also not useful at all. svn path=/trunk/KDE/kdebase/workspace/; revision=689949
This commit is contained in:
parent
824f005f58
commit
ab1582de27
9 changed files with 25 additions and 64 deletions
|
@ -235,7 +235,7 @@ void Client::releaseWindow( bool on_shutdown )
|
|||
XDeleteProperty( display(), client, atoms->kde_net_wm_user_creation_time);
|
||||
XDeleteProperty( display(), client, atoms->net_frame_extents );
|
||||
XDeleteProperty( display(), client, atoms->kde_net_wm_frame_strut );
|
||||
XReparentWindow( display(), client, workspace()->rootWin(), x(), y());
|
||||
XReparentWindow( display(), client, rootWindow(), x(), y());
|
||||
XRemoveFromSaveSet( display(), client );
|
||||
XSelectInput( display(), client, NoEventMask );
|
||||
if( on_shutdown )
|
||||
|
|
4
client.h
4
client.h
|
@ -555,14 +555,14 @@ inline Client* Client::transientFor()
|
|||
|
||||
inline bool Client::groupTransient() const
|
||||
{
|
||||
return transient_for_id == workspace()->rootWin();
|
||||
return transient_for_id == rootWindow();
|
||||
}
|
||||
|
||||
// needed because verifyTransientFor() may set transient_for_id to root window,
|
||||
// if the original value has a problem (window doesn't exist, etc.)
|
||||
inline bool Client::wasOriginallyGroupTransient() const
|
||||
{
|
||||
return original_transient_for_id == workspace()->rootWin();
|
||||
return original_transient_for_id == rootWindow();
|
||||
}
|
||||
|
||||
inline bool Client::isTransient() const
|
||||
|
|
15
events.cpp
15
events.cpp
|
@ -309,7 +309,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
switch (e->type)
|
||||
{
|
||||
case CreateNotify:
|
||||
if ( e->xcreatewindow.parent == root &&
|
||||
if ( e->xcreatewindow.parent == rootWindow() &&
|
||||
!QWidget::find( e->xcreatewindow.window) &&
|
||||
!e->xcreatewindow.override_redirect )
|
||||
{
|
||||
|
@ -351,13 +351,8 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
// children of WindowWrapper (=clients), the check is AFAIK useless anyway
|
||||
// Note: Now the save-set support in Client::mapRequestEvent() actually requires that
|
||||
// this code doesn't check the parent to be root.
|
||||
// if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids
|
||||
// if ( e->xmaprequest.parent == root ) {
|
||||
c = createClient( e->xmaprequest.window, false );
|
||||
if ( c != NULL && root != rootWindow() )
|
||||
{ // TODO what is this?
|
||||
// TODO may use QWidget::create
|
||||
XReparentWindow( display(), c->frameId(), root, 0, 0 );
|
||||
}
|
||||
if( c == NULL ) // refused to manage, simply map it (most probably override redirect)
|
||||
XMapRaised( display(), e->xmaprequest.window );
|
||||
return true;
|
||||
|
@ -407,7 +402,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
}
|
||||
case ConfigureRequest:
|
||||
{
|
||||
if ( e->xconfigurerequest.parent == root )
|
||||
if ( e->xconfigurerequest.parent == rootWindow())
|
||||
{
|
||||
XWindowChanges wc;
|
||||
wc.border_width = e->xconfigurerequest.border_width;
|
||||
|
@ -433,7 +428,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
return false;
|
||||
break;
|
||||
case FocusIn:
|
||||
if( e->xfocus.window == rootWin()
|
||||
if( e->xfocus.window == rootWindow()
|
||||
&& ( e->xfocus.detail == NotifyDetailNone || e->xfocus.detail == NotifyPointerRoot ))
|
||||
{
|
||||
updateXTime(); // focusToNull() uses xTime(), which is old now (FocusIn has no timestamp)
|
||||
|
@ -761,7 +756,7 @@ void Client::unmapNotifyEvent( XUnmapEvent* e )
|
|||
if( e->event != wrapperId())
|
||||
{ // most probably event from root window when initially reparenting
|
||||
bool ignore = true;
|
||||
if( e->event == workspace()->rootWin() && e->send_event )
|
||||
if( e->event == rootWindow() && e->send_event )
|
||||
ignore = false; // XWithdrawWindow()
|
||||
if( ignore )
|
||||
return;
|
||||
|
|
|
@ -2287,7 +2287,7 @@ bool Client::startMoveResize()
|
|||
// (http://lists.kde.org/?t=107302193400001&r=1&w=2)
|
||||
XSetWindowAttributes attrs;
|
||||
QRect r = workspace()->clientArea( FullArea, this );
|
||||
move_resize_grab_window = XCreateWindow( display(), workspace()->rootWin(), r.x(), r.y(),
|
||||
move_resize_grab_window = XCreateWindow( display(), rootWindow(), r.x(), r.y(),
|
||||
r.width(), r.height(), 0, CopyFromParent, InputOnly, CopyFromParent, 0, &attrs );
|
||||
XMapRaised( display(), move_resize_grab_window );
|
||||
if( XGrabPointer( display(), move_resize_grab_window, False,
|
||||
|
|
20
group.cpp
20
group.cpp
|
@ -211,7 +211,7 @@ Group::Group( Window leader_P, Workspace* workspace_P )
|
|||
{
|
||||
leader_client = workspace_P->findClient( WindowMatchPredicate( leader_P ));
|
||||
unsigned long properties[ 2 ] = { 0, NET::WM2StartupId };
|
||||
leader_info = new NETWinInfo( display(), leader_P, workspace()->rootWin(),
|
||||
leader_info = new NETWinInfo( display(), leader_P, rootWindow(),
|
||||
properties, 2 );
|
||||
}
|
||||
effect_group = new EffectWindowGroupImpl( this );
|
||||
|
@ -773,23 +773,23 @@ Window Client::verifyTransientFor( Window new_transient_for, bool defined )
|
|||
// make sure splashscreens are shown above all their app's windows, even though
|
||||
// they're in Normal layer
|
||||
if( isSplash() && new_transient_for == None )
|
||||
new_transient_for = workspace()->rootWin();
|
||||
new_transient_for = rootWindow();
|
||||
if( new_transient_for == None )
|
||||
if( defined ) // sometimes WM_TRANSIENT_FOR is set to None, instead of root window
|
||||
new_property_value = new_transient_for = workspace()->rootWin();
|
||||
new_property_value = new_transient_for = rootWindow();
|
||||
else
|
||||
return None;
|
||||
if( new_transient_for == window()) // pointing to self
|
||||
{ // also fix the property itself
|
||||
kWarning( 1216 ) << "Client " << this << " has WM_TRANSIENT_FOR poiting to itself." << endl;
|
||||
new_property_value = new_transient_for = workspace()->rootWin();
|
||||
new_property_value = new_transient_for = rootWindow();
|
||||
}
|
||||
// The transient_for window may be embedded in another application,
|
||||
// so kwin cannot see it. Try to find the managed client for the
|
||||
// window and fix the transient_for property if possible.
|
||||
WId before_search = new_transient_for;
|
||||
while( new_transient_for != None
|
||||
&& new_transient_for != workspace()->rootWin()
|
||||
&& new_transient_for != rootWindow()
|
||||
&& !workspace()->findClient( WindowMatchPredicate( new_transient_for )))
|
||||
{
|
||||
Window root_return, parent_return;
|
||||
|
@ -818,7 +818,7 @@ Window Client::verifyTransientFor( Window new_transient_for, bool defined )
|
|||
// windows in the group
|
||||
int count = 20;
|
||||
Window loop_pos = new_transient_for;
|
||||
while( loop_pos != None && loop_pos != workspace()->rootWin())
|
||||
while( loop_pos != None && loop_pos != rootWindow())
|
||||
{
|
||||
Client* pos = workspace()->findClient( WindowMatchPredicate( loop_pos ));
|
||||
if( pos == NULL )
|
||||
|
@ -827,13 +827,13 @@ Window Client::verifyTransientFor( Window new_transient_for, bool defined )
|
|||
if( --count == 0 )
|
||||
{
|
||||
kWarning( 1216 ) << "Client " << this << " caused WM_TRANSIENT_FOR loop." << endl;
|
||||
new_transient_for = workspace()->rootWin();
|
||||
new_transient_for = rootWindow();
|
||||
}
|
||||
}
|
||||
if( new_transient_for != workspace()->rootWin()
|
||||
if( new_transient_for != rootWindow()
|
||||
&& workspace()->findClient( WindowMatchPredicate( new_transient_for )) == NULL )
|
||||
{ // it's transient for a specific window, but that window is not mapped
|
||||
new_transient_for = workspace()->rootWin();
|
||||
new_transient_for = rootWindow();
|
||||
}
|
||||
if( new_property_value != original_transient_for_id )
|
||||
XSetTransientForHint( display(), window(), new_property_value );
|
||||
|
@ -869,7 +869,7 @@ void Client::removeTransient( Client* cl )
|
|||
{
|
||||
cl->transient_for_id = None;
|
||||
cl->transient_for = NULL; // SELI
|
||||
// SELI cl->setTransient( workspace()->rootWin());
|
||||
// SELI cl->setTransient( rootWindow());
|
||||
cl->setTransient( None );
|
||||
}
|
||||
}
|
||||
|
|
2
rules.h
2
rules.h
|
@ -177,7 +177,7 @@ class Rules
|
|||
bool wmclasscomplete;
|
||||
QByteArray windowrole;
|
||||
StringMatch windowrolematch;
|
||||
QString title; // TODO "caption" ?
|
||||
QString title;
|
||||
StringMatch titlematch;
|
||||
QByteArray extrarole;
|
||||
StringMatch extrarolematch;
|
||||
|
|
12
tabbox.cpp
12
tabbox.cpp
|
@ -833,8 +833,6 @@ static bool areModKeysDepressed( const KShortcut& cut )
|
|||
|
||||
void Workspace::slotWalkThroughWindows()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if ( tab_grab || control_grab )
|
||||
return;
|
||||
if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable())
|
||||
|
@ -859,8 +857,6 @@ void Workspace::slotWalkThroughWindows()
|
|||
|
||||
void Workspace::slotWalkBackThroughWindows()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if( tab_grab || control_grab )
|
||||
return;
|
||||
if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable())
|
||||
|
@ -884,8 +880,6 @@ void Workspace::slotWalkBackThroughWindows()
|
|||
|
||||
void Workspace::slotWalkThroughDesktops()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if( tab_grab || control_grab )
|
||||
return;
|
||||
if ( areModKeysDepressed( cutWalkThroughDesktops ) )
|
||||
|
@ -901,8 +895,6 @@ void Workspace::slotWalkThroughDesktops()
|
|||
|
||||
void Workspace::slotWalkBackThroughDesktops()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if( tab_grab || control_grab )
|
||||
return;
|
||||
if ( areModKeysDepressed( cutWalkThroughDesktopsReverse ) )
|
||||
|
@ -918,8 +910,6 @@ void Workspace::slotWalkBackThroughDesktops()
|
|||
|
||||
void Workspace::slotWalkThroughDesktopList()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if( tab_grab || control_grab )
|
||||
return;
|
||||
if ( areModKeysDepressed( cutWalkThroughDesktopList ) )
|
||||
|
@ -935,8 +925,6 @@ void Workspace::slotWalkThroughDesktopList()
|
|||
|
||||
void Workspace::slotWalkBackThroughDesktopList()
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return;
|
||||
if( tab_grab || control_grab )
|
||||
return;
|
||||
if ( areModKeysDepressed( cutWalkThroughDesktopListReverse ) )
|
||||
|
|
|
@ -110,7 +110,6 @@ Workspace::Workspace( bool restore )
|
|||
disable_shortcuts_keys ( NULL ),
|
||||
global_shortcuts_disabled( false ),
|
||||
global_shortcuts_disabled_for_client( false ),
|
||||
root (0),
|
||||
workspaceInit (true),
|
||||
startup(0),
|
||||
layoutOrientation(Qt::Vertical),
|
||||
|
@ -138,7 +137,6 @@ Workspace::Workspace( bool restore )
|
|||
dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", this, SLOT(slotReloadConfig()));
|
||||
_self = this;
|
||||
mgr = new PluginMgr;
|
||||
root = rootWindow();
|
||||
QX11Info info;
|
||||
default_colormap = DefaultColormap(display(), info.screen() );
|
||||
installed_colormap = default_colormap;
|
||||
|
@ -175,7 +173,7 @@ Workspace::Workspace( bool restore )
|
|||
KStartupInfo::DisableKWinModule | KStartupInfo::AnnounceSilenceChanges, this );
|
||||
|
||||
// select windowmanager privileges
|
||||
XSelectInput(display(), root,
|
||||
XSelectInput(display(), rootWindow(),
|
||||
KeyPressMask |
|
||||
PropertyChangeMask |
|
||||
ColormapChangeMask |
|
||||
|
@ -370,7 +368,7 @@ void Workspace::init()
|
|||
|
||||
unsigned int i, nwins;
|
||||
Window root_return, parent_return, *wins;
|
||||
XQueryTree(display(), root, &root_return, &parent_return, &wins, &nwins);
|
||||
XQueryTree(display(), rootWindow(), &root_return, &parent_return, &wins, &nwins);
|
||||
for (i = 0; i < nwins; i++)
|
||||
{
|
||||
XWindowAttributes attr;
|
||||
|
@ -383,15 +381,7 @@ void Workspace::init()
|
|||
if( topmenu_space && topmenu_space->winId() == wins[ i ] )
|
||||
continue;
|
||||
if (attr.map_state != IsUnmapped)
|
||||
{
|
||||
Client* c = createClient( wins[i], true );
|
||||
if ( c != NULL && root != rootWindow() )
|
||||
{ // TODO what is this?
|
||||
// TODO may use QWidget:.create
|
||||
XReparentWindow( display(), c->frameId(), root, 0, 0 );
|
||||
c->move(0,0);
|
||||
}
|
||||
}
|
||||
createClient( wins[i], true );
|
||||
}
|
||||
if ( wins )
|
||||
XFree((void *) wins);
|
||||
|
@ -462,7 +452,6 @@ Workspace::~Workspace()
|
|||
delete tab_box;
|
||||
delete popupinfo;
|
||||
delete popup;
|
||||
if ( root == rootWindow() )
|
||||
XDeleteProperty(display(), rootWindow(), atoms->kwin_running);
|
||||
|
||||
writeWindowRules();
|
||||
|
@ -1948,8 +1937,6 @@ unsigned int Workspace::sendFakedMouseEvent( QPoint pos, WId w, MouseEmulation t
|
|||
*/
|
||||
bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
|
||||
{
|
||||
if ( root != rootWindow() )
|
||||
return false;
|
||||
int kc = XKeycodeToKeysym(display(), ev.keycode, 0);
|
||||
int km = ev.state & (ControlMask | Mod1Mask | ShiftMask);
|
||||
|
||||
|
|
|
@ -82,8 +82,6 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
|
||||
void killWindow() { slotKillWindow(); }
|
||||
|
||||
WId rootWin() const;
|
||||
|
||||
bool initializing() const;
|
||||
|
||||
/**
|
||||
|
@ -650,8 +648,6 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
bool global_shortcuts_disabled;
|
||||
bool global_shortcuts_disabled_for_client;
|
||||
|
||||
WId root;
|
||||
|
||||
PluginMgr *mgr;
|
||||
|
||||
RootInfo *rootInfo;
|
||||
|
@ -757,11 +753,6 @@ class RootInfo : public NETRootInfo
|
|||
};
|
||||
|
||||
|
||||
inline WId Workspace::rootWin() const
|
||||
{
|
||||
return root;
|
||||
}
|
||||
|
||||
inline bool Workspace::initializing() const
|
||||
{
|
||||
return workspaceInit;
|
||||
|
|
Loading…
Reference in a new issue