twin: Minor code cleanup and refactoring

Refactoring concerns active border code.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/371/head
Mavridis Philippe 10 months ago
parent becae3055b
commit 0339423ced
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -178,7 +178,7 @@ Client::Client( Workspace *ws )
max_mode = MaximizeRestore; max_mode = MaximizeRestore;
maxmode_restore = MaximizeRestore; maxmode_restore = MaximizeRestore;
cmap = None; cmap = None;
frame_geometry = TQRect( 0, 0, 100, 100 ); // so that decorations don't start with size being (0,0) frame_geometry = TQRect( 0, 0, 100, 100 ); // so that decorations don't start with size being (0,0)
@ -262,7 +262,7 @@ void Client::releaseWindow( bool on_shutdown )
{ {
// Make sure it's not mapped if the app unmapped it (#65279). The app // Make sure it's not mapped if the app unmapped it (#65279). The app
// may do map+unmap before we initially map the window by calling rawShow() from manage(). // may do map+unmap before we initially map the window by calling rawShow() from manage().
XUnmapWindow( tqt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
} }
client = None; client = None;
XDestroyWindow( tqt_xdisplay(), wrapper ); XDestroyWindow( tqt_xdisplay(), wrapper );
@ -526,7 +526,7 @@ bool Client::isModalSystemNotification() const
void Client::updateShape() void Client::updateShape()
{ {
// workaround for #19644 - shaped windows shouldn't have decoration // workaround for #19644 - shaped windows shouldn't have decoration
if( shape() && !noBorder()) if( shape() && !noBorder())
{ {
noborder = true; noborder = true;
updateDecoration( true ); updateDecoration( true );
@ -605,7 +605,7 @@ TQRegion Client::mask() const
return TQRegion( 0, 0, width(), height()); return TQRegion( 0, 0, width(), height());
return _mask; return _mask;
} }
void Client::setShapable(bool b) void Client::setShapable(bool b)
{ {
long tmp = b?1:0; long tmp = b?1:0;
@ -747,12 +747,12 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
TQPixmap pm = animationPixmap( minimize ? width() : icongeom.width() ); TQPixmap pm = animationPixmap( minimize ? width() : icongeom.width() );
TQRect before, after; TQRect before, after;
if ( minimize ) if ( minimize )
{ {
before = TQRect( x(), y(), width(), pm.height() ); before = TQRect( x(), y(), width(), pm.height() );
after = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() ); after = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() );
} }
else else
{ {
before = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() ); before = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() );
after = TQRect( x(), y(), width(), pm.height() ); after = TQRect( x(), y(), width(), pm.height() );
@ -776,14 +776,14 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
TQPainter p ( workspace()->desktopWidget() ); TQPainter p ( workspace()->desktopWidget() );
bool need_to_clear = FALSE; bool need_to_clear = FALSE;
TQPixmap pm3; TQPixmap pm3;
do do
{ {
if (area2 != area) if (area2 != area)
{ {
pm = animationPixmap( area.width() ); pm = animationPixmap( area.width() );
pm2 = TQPixmap::grabWindow( tqt_xrootwin(), area.x(), area.y(), area.width(), area.height() ); pm2 = TQPixmap::grabWindow( tqt_xrootwin(), area.x(), area.y(), area.width(), area.height() );
p.drawPixmap( area.x(), area.y(), pm ); p.drawPixmap( area.x(), area.y(), pm );
if ( need_to_clear ) if ( need_to_clear )
{ {
p.drawPixmap( area2.x(), area2.y(), pm3 ); p.drawPixmap( area2.x(), area2.y(), pm3 );
need_to_clear = FALSE; need_to_clear = FALSE;
@ -799,11 +799,11 @@ void Client::animateMinimizeOrUnminimize( bool minimize )
area.setRight(before.right() + int(diff*rf)); area.setRight(before.right() + int(diff*rf));
area.setTop(before.top() + int(diff*tf)); area.setTop(before.top() + int(diff*tf));
area.setBottom(before.bottom() + int(diff*bf)); area.setBottom(before.bottom() + int(diff*bf));
if (area2 != area ) if (area2 != area )
{ {
if ( area2.intersects( area ) ) if ( area2.intersects( area ) )
p.drawPixmap( area2.x(), area2.y(), pm2 ); p.drawPixmap( area2.x(), area2.y(), pm2 );
else else
{ // no overlap, we can clear later to avoid flicker { // no overlap, we can clear later to avoid flicker
pm3 = pm2; pm3 = pm2;
need_to_clear = TRUE; need_to_clear = TRUE;
@ -877,7 +877,7 @@ void Client::setShade( ShadeMode mode )
int as = options->animateShade? 10 : 1; int as = options->animateShade? 10 : 1;
// TODO all this unmapping, resizing etc. feels too much duplicated from elsewhere // TODO all this unmapping, resizing etc. feels too much duplicated from elsewhere
if ( isShade()) if ( isShade())
{ // shade_mode == ShadeNormal { // shade_mode == ShadeNormal
// we're about to shade, texx xcompmgr to prepare // we're about to shade, texx xcompmgr to prepare
long _shade = 1; long _shade = 1;
@ -891,13 +891,13 @@ void Client::setShade( ShadeMode mode )
XUnmapWindow( tqt_xdisplay(), wrapper ); XUnmapWindow( tqt_xdisplay(), wrapper );
XUnmapWindow( tqt_xdisplay(), client ); XUnmapWindow( tqt_xdisplay(), client );
XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask ); XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask );
//as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it //as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it
//done xcompmgr workaround //done xcompmgr workaround
// FRAME repaint( FALSE ); // FRAME repaint( FALSE );
// bool wasStaticContents = testWFlags( WStaticContents ); // bool wasStaticContents = testWFlags( WStaticContents );
// setWFlags( WStaticContents ); // setWFlags( WStaticContents );
int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; int step = TQMAX( 4, QABS( h - s.height() ) / as )+1;
do do
{ {
h -= step; h -= step;
XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h );
@ -917,9 +917,9 @@ void Client::setShade( ShadeMode mode )
} }
// tell xcompmgr shade's done // tell xcompmgr shade's done
_shade = 2; _shade = 2;
XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L);
} }
else else
{ {
int h = height(); int h = height();
shade_geometry_change = true; shade_geometry_change = true;
@ -927,7 +927,7 @@ void Client::setShade( ShadeMode mode )
// FRAME bool wasStaticContents = testWFlags( WStaticContents ); // FRAME bool wasStaticContents = testWFlags( WStaticContents );
// setWFlags( WStaticContents ); // setWFlags( WStaticContents );
int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; int step = TQMAX( 4, QABS( h - s.height() ) / as )+1;
do do
{ {
h += step; h += step;
XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h );
@ -1733,14 +1733,14 @@ void Client::closeWindow()
if( !isCloseable()) if( !isCloseable())
return; return;
// Update user time, because the window may create a confirming dialog. // Update user time, because the window may create a confirming dialog.
updateUserTime(); updateUserTime();
if ( Pdeletewindow ) if ( Pdeletewindow )
{ {
Notify::raise( Notify::Close ); Notify::raise( Notify::Close );
sendClientMessage( window(), atoms->wm_protocols, atoms->wm_delete_window); sendClientMessage( window(), atoms->wm_protocols, atoms->wm_delete_window);
pingWindow(); pingWindow();
} }
else else
{ {
// client will not react on wm_delete_window. We have not choice // client will not react on wm_delete_window. We have not choice
// but destroy his connection to the XServer. // but destroy his connection to the XServer.
@ -2267,7 +2267,7 @@ bool Client::providesContextHelp() const
*/ */
void Client::showContextHelp() void Client::showContextHelp()
{ {
if ( Pcontexthelp ) if ( Pcontexthelp )
{ {
sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help); sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help);
TQWhatsThis::enterWhatsThisMode(); // SELI? TQWhatsThis::enterWhatsThisMode(); // SELI?
@ -2286,17 +2286,17 @@ void Client::fetchName()
TQString Client::readName() const TQString Client::readName() const
{ {
if ( info->name() && info->name()[ 0 ] != '\0' ) if ( info->name() && info->name()[ 0 ] != '\0' )
return TQString::fromUtf8( info->name() ); return TQString::fromUtf8( info->name() );
else else
return KWin::readNameProperty( window(), XA_WM_NAME ); return KWin::readNameProperty( window(), XA_WM_NAME );
} }
KWIN_COMPARE_PREDICATE( FetchNameInternalPredicate, const Client*, (!cl->isSpecialWindow() || cl->isToolbar()) && cl != value && cl->caption() == value->caption()); KWIN_COMPARE_PREDICATE( FetchNameInternalPredicate, const Client*, (!cl->isSpecialWindow() || cl->isToolbar()) && cl != value && cl->caption() == value->caption());
void Client::setCaption( const TQString& s, bool force ) void Client::setCaption( const TQString& s, bool force )
{ {
if ( s != cap_normal || force ) if ( s != cap_normal || force )
{ {
bool reset_name = force; bool reset_name = force;
for( unsigned int i = 0; for( unsigned int i = 0;
@ -2311,10 +2311,10 @@ void Client::setCaption( const TQString& s, bool force )
machine_suffix = " <@" + wmClientMachine( true ) + ">"; machine_suffix = " <@" + wmClientMachine( true ) + ">";
TQString shortcut_suffix = !shortcut().isNull() ? ( " {" + shortcut().toString() + "}" ) : ""; TQString shortcut_suffix = !shortcut().isNull() ? ( " {" + shortcut().toString() + "}" ) : "";
cap_suffix = machine_suffix + shortcut_suffix; cap_suffix = machine_suffix + shortcut_suffix;
if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this ))) if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this )))
{ {
int i = 2; int i = 2;
do do
{ {
cap_suffix = machine_suffix + " <" + TQString::number(i) + ">" + shortcut_suffix; cap_suffix = machine_suffix + " <" + TQString::number(i) + ">" + shortcut_suffix;
i++; i++;
@ -2344,11 +2344,11 @@ void Client::updateCaption()
void Client::fetchIconicName() void Client::fetchIconicName()
{ {
TQString s; TQString s;
if ( info->iconName() && info->iconName()[ 0 ] != '\0' ) if ( info->iconName() && info->iconName()[ 0 ] != '\0' )
s = TQString::fromUtf8( info->iconName() ); s = TQString::fromUtf8( info->iconName() );
else else
s = KWin::readNameProperty( window(), XA_WM_ICON_NAME ); s = KWin::readNameProperty( window(), XA_WM_ICON_NAME );
if ( s != cap_iconic ) if ( s != cap_iconic )
{ {
bool was_set = !cap_iconic.isEmpty(); bool was_set = !cap_iconic.isEmpty();
cap_iconic = s; cap_iconic = s;
@ -2409,7 +2409,7 @@ void Client::getMotifHints()
} }
void Client::readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon ) void Client::readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon )
{ {
// get the icons, allow scaling // get the icons, allow scaling
if( icon != NULL ) if( icon != NULL )
*icon = KWin::icon( win, 32, 32, TRUE, KWin::NETWM | KWin::WMHints ); *icon = KWin::icon( win, 32, 32, TRUE, KWin::NETWM | KWin::WMHints );
@ -2525,7 +2525,7 @@ Window Client::staticWmClientLeader(WId w)
FALSE, XA_WINDOW, &type, &format, FALSE, XA_WINDOW, &type, &format,
&nitems, &extra, &data ); &nitems, &extra, &data );
XSetErrorHandler(oldHandler); XSetErrorHandler(oldHandler);
if (status == Success ) if (status == Success )
{ {
if (data && nitems > 0) if (data && nitems > 0)
result = *((Window*) data); result = *((Window*) data);
@ -2703,7 +2703,7 @@ void Client::setCursor( Position m )
{ {
m = PositionCenter; m = PositionCenter;
} }
switch ( m ) switch ( m )
{ {
case PositionTopLeft: case PositionTopLeft:
case PositionBottomRight: case PositionBottomRight:
@ -2977,7 +2977,7 @@ void Client::updateOpacity()
} }
} }
} }
void Client::updateShadowSize() void Client::updateShadowSize()
// extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows) // extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows)
{ {
@ -2998,7 +2998,7 @@ uint Client::ruleOpacityActive()
{ {
return rule_opacity_active;// != 0; return rule_opacity_active;// != 0;
} }
bool Client::getWindowOpacity() //query translucency settings from X, returns true if window opacity is set bool Client::getWindowOpacity() //query translucency settings from X, returns true if window opacity is set
{ {
unsigned char *data = 0; unsigned char *data = 0;
@ -3016,12 +3016,12 @@ bool Client::getWindowOpacity() //query translucency settings from X, returns tr
} }
return FALSE; return FALSE;
} }
void Client::setCustomOpacityFlag(bool custom) void Client::setCustomOpacityFlag(bool custom)
{ {
custom_opacity = custom; custom_opacity = custom;
} }
uint Client::opacity() uint Client::opacity()
{ {
return opacity_; return opacity_;
@ -3031,7 +3031,7 @@ int Client::opacityPercentage()
{ {
return int(100*((double)opacity_/0xffffffff)); return int(100*((double)opacity_/0xffffffff));
} }
bool Client::touches(const Client* c) bool Client::touches(const Client* c)
// checks if this client borders c, needed to test beep media player window state // checks if this client borders c, needed to test beep media player window state
{ {
@ -3045,7 +3045,7 @@ bool Client::touches(const Client* c)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth) void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth)
{ {
long data = (topHeight < 255 ? topHeight : 255) << 24 | long data = (topHeight < 255 ? topHeight : 255) << 24 |
@ -3059,7 +3059,7 @@ void Client::unsetDecoHashProperty()
{ {
XDeleteProperty( tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash); XDeleteProperty( tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash);
} }
#ifndef NDEBUG #ifndef NDEBUG
kdbgstream& operator<<( kdbgstream& stream, const Client* cl ) kdbgstream& operator<<( kdbgstream& stream, const Client* cl )
{ {

@ -455,7 +455,7 @@ class Client : public TQObject, public KDecorationDefines
static void sendClientMessage( Window w, Atom a, Atom protocol, static void sendClientMessage( Window w, Atom a, Atom protocol,
long data1 = 0, long data2 = 0, long data3 = 0 ); long data1 = 0, long data2 = 0, long data3 = 0 );
void embedClient( Window w, const XWindowAttributes &attr ); void embedClient( Window w, const XWindowAttributes &attr );
void detectNoBorder(); void detectNoBorder();
void detectShapable(); void detectShapable();
void destroyDecoration(); void destroyDecoration();
@ -482,11 +482,11 @@ class Client : public TQObject, public KDecorationDefines
bool move_faked_activity; bool move_faked_activity;
Window move_resize_grab_window; Window move_resize_grab_window;
bool unrestrictedMoveResize; bool unrestrictedMoveResize;
bool isMove() const bool isMove() const
{ {
return moveResizeMode && mode == PositionCenter; return moveResizeMode && mode == PositionCenter;
} }
bool isResize() const bool isResize() const
{ {
return moveResizeMode && mode != PositionCenter; return moveResizeMode && mode != PositionCenter;
} }
@ -959,7 +959,7 @@ inline bool Client::hasUserTimeSupport() const
{ {
return info->userTime() != -1U; return info->userTime() != -1U;
} }
inline bool Client::ignoreFocusStealing() const inline bool Client::ignoreFocusStealing() const
{ {
return ignore_focus_stealing; return ignore_focus_stealing;

@ -194,7 +194,7 @@ void RootInfo::changeShowingDesktop( bool showing )
*/ */
bool Workspace::workspaceEvent( XEvent * e ) bool Workspace::workspaceEvent( XEvent * e )
{ {
if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) ) if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) )
{ {
mouse_emulation = FALSE; mouse_emulation = FALSE;
XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() ); XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() );
@ -211,7 +211,7 @@ bool Workspace::workspaceEvent( XEvent * e )
} }
// events that should be handled before Clients can get them // events that should be handled before Clients can get them
switch (e->type) switch (e->type)
{ {
case ButtonPress: case ButtonPress:
case ButtonRelease: case ButtonRelease:
@ -284,7 +284,7 @@ bool Workspace::workspaceEvent( XEvent * e )
return true; return true;
} }
switch (e->type) switch (e->type)
{ {
case CreateNotify: case CreateNotify:
if ( e->xcreatewindow.parent == root && if ( e->xcreatewindow.parent == root &&
@ -303,7 +303,7 @@ bool Workspace::workspaceEvent( XEvent * e )
case UnmapNotify: case UnmapNotify:
{ {
// check for system tray windows // check for system tray windows
if ( removeSystemTrayWin( e->xunmap.window, true ) ) if ( removeSystemTrayWin( e->xunmap.window, true ) )
{ {
// If the system tray gets destroyed, the system tray // If the system tray gets destroyed, the system tray
// icons automatically get unmapped, reparented and mapped // icons automatically get unmapped, reparented and mapped
@ -317,7 +317,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( XCheckTypedWindowEvent (tqt_xdisplay(), w, if ( XCheckTypedWindowEvent (tqt_xdisplay(), w,
ReparentNotify, &ev) ) ReparentNotify, &ev) )
{ {
if ( ev.xreparent.parent != root ) if ( ev.xreparent.parent != root )
{ {
XReparentWindow( tqt_xdisplay(), w, root, 0, 0 ); XReparentWindow( tqt_xdisplay(), w, root, 0, 0 );
addSystemTrayWin( w ); addSystemTrayWin( w );
@ -351,7 +351,7 @@ bool Workspace::workspaceEvent( XEvent * e )
// e->xmaprequest.window is different from e->xany.window // e->xmaprequest.window is different from e->xany.window
// TODO this shouldn't be necessary now // TODO this shouldn't be necessary now
Client* c = findClient( WindowMatchPredicate( e->xmaprequest.window )); Client* c = findClient( WindowMatchPredicate( e->xmaprequest.window ));
if ( !c ) if ( !c )
{ {
// don't check for the parent being the root window, this breaks when some app unmaps // don't check for the parent being the root window, this breaks when some app unmaps
// a window, changes something and immediately maps it back, without giving KWin // a window, changes something and immediately maps it back, without giving KWin
@ -364,7 +364,7 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( addSystemTrayWin( e->xmaprequest.window ) ) if ( addSystemTrayWin( e->xmaprequest.window ) )
return TRUE; return TRUE;
c = createClient( e->xmaprequest.window, false ); c = createClient( e->xmaprequest.window, false );
if ( c != NULL && root != tqt_xrootwin() ) if ( c != NULL && root != tqt_xrootwin() )
{ // TODO what is this? { // TODO what is this?
// TODO may use TQWidget::create // TODO may use TQWidget::create
XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 ); XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 );
@ -405,7 +405,7 @@ bool Workspace::workspaceEvent( XEvent * e )
} }
case ConfigureRequest: case ConfigureRequest:
{ {
if ( e->xconfigurerequest.parent == root ) if ( e->xconfigurerequest.parent == root )
{ {
XWindowChanges wc; XWindowChanges wc;
wc.border_width = e->xconfigurerequest.border_width; wc.border_width = e->xconfigurerequest.border_width;
@ -542,7 +542,7 @@ bool Client::windowEvent( XEvent* e )
} }
// TODO move all focus handling stuff to separate file? // TODO move all focus handling stuff to separate file?
switch (e->type) switch (e->type)
{ {
case UnmapNotify: case UnmapNotify:
unmapNotifyEvent( &e->xunmap ); unmapNotifyEvent( &e->xunmap );
@ -800,7 +800,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e )
return; return;
} }
if ( e->value_mask & CWBorderWidth ) if ( e->value_mask & CWBorderWidth )
{ {
// first, get rid of a window border // first, get rid of a window border
XWindowChanges wc; XWindowChanges wc;
@ -836,7 +836,7 @@ void Client::propertyNotifyEvent( XPropertyEvent* e )
{ {
if( e->window != window()) if( e->window != window())
return; // ignore frame/wrapper return; // ignore frame/wrapper
switch ( e->atom ) switch ( e->atom )
{ {
case XA_WM_NORMAL_HINTS: case XA_WM_NORMAL_HINTS:
getWmNormalHints(); getWmNormalHints();
@ -874,10 +874,10 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
return; // care only about entering the whole frame return; // care only about entering the whole frame
if( e->mode == NotifyNormal || if( e->mode == NotifyNormal ||
( !options->focusPolicyIsReasonable() && ( !options->focusPolicyIsReasonable() &&
e->mode == NotifyUngrab ) ) e->mode == NotifyUngrab ) )
{ {
if (options->shadeHover && isShade()) if (options->shadeHover && isShade())
{ {
delete shadeHoverTimer; delete shadeHoverTimer;
shadeHoverTimer = new TQTimer( this ); shadeHoverTimer = new TQTimer( this );
@ -890,7 +890,7 @@ void Client::enterNotifyEvent( XCrossingEvent* e )
if ( options->autoRaise && !isDesktop() && if ( options->autoRaise && !isDesktop() &&
!isDock() && !isTopMenu() && workspace()->focusChangeEnabled() && !isDock() && !isTopMenu() && workspace()->focusChangeEnabled() &&
workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this ) workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this )
{ {
delete autoRaiseTimer; delete autoRaiseTimer;
autoRaiseTimer = new TQTimer( this ); autoRaiseTimer = new TQTimer( this );
@ -919,9 +919,9 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
{ {
if( e->window != frameId()) if( e->window != frameId())
return; // care only about leaving the whole frame return; // care only about leaving the whole frame
if ( e->mode == NotifyNormal ) if ( e->mode == NotifyNormal )
{ {
if ( !buttonDown ) if ( !buttonDown )
{ {
mode = PositionCenter; mode = PositionCenter;
setCursor( tqarrowCursor ); setCursor( tqarrowCursor );
@ -934,7 +934,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
// TODO this still sucks if a window appears above this one - it should lose the mouse // TODO this still sucks if a window appears above this one - it should lose the mouse
// if this window is another client, but not if it's a popup ... maybe after KDE3.1 :( // if this window is another client, but not if it's a popup ... maybe after KDE3.1 :(
// (repeat after me 'AARGHL!') // (repeat after me 'AARGHL!')
if ( !lostMouse && e->detail != NotifyInferior ) if ( !lostMouse && e->detail != NotifyInferior )
{ {
int d1, d2, d3, d4; int d1, d2, d3, d4;
unsigned int d5; unsigned int d5;
@ -943,7 +943,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
|| child == None ) || child == None )
lostMouse = true; // really lost the mouse lostMouse = true; // really lost the mouse
} }
if ( lostMouse ) if ( lostMouse )
{ {
cancelAutoRaise(); cancelAutoRaise();
workspace()->cancelDelayFocus(); workspace()->cancelDelayFocus();
@ -963,7 +963,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e )
#define XScrL KKeyNative::modXScrollLock() #define XScrL KKeyNative::modXScrollLock()
void Client::grabButton( int modifier ) void Client::grabButton( int modifier )
{ {
unsigned int mods[ 8 ] = unsigned int mods[ 8 ] =
{ {
0, XCapL, XNumL, XNumL | XCapL, 0, XCapL, XNumL, XNumL | XCapL,
XScrL, XScrL | XCapL, XScrL, XScrL | XCapL,
@ -980,7 +980,7 @@ void Client::grabButton( int modifier )
void Client::ungrabButton( int modifier ) void Client::ungrabButton( int modifier )
{ {
unsigned int mods[ 8 ] = unsigned int mods[ 8 ] =
{ {
0, XCapL, XNumL, XNumL | XCapL, 0, XCapL, XNumL, XNumL | XCapL,
XScrL, XScrL | XCapL, XScrL, XScrL | XCapL,
@ -1054,7 +1054,7 @@ int qtToX11Button( TQt::ButtonState button )
return Button3; return Button3;
return AnyButton; return AnyButton;
} }
int qtToX11State( TQt::ButtonState state ) int qtToX11State( TQt::ButtonState state )
{ {
int ret = 0; int ret = 0;
@ -1368,7 +1368,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
if ( bModKeyHeld ) if ( bModKeyHeld )
{ {
was_action = true; was_action = true;
switch (button) switch (button)
{ {
case Button1: case Button1:
com = options->commandAll1(); com = options->commandAll1();
@ -1391,7 +1391,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in
{ {
was_action = true; was_action = true;
perform_handled = true; perform_handled = true;
switch (button) switch (button)
{ {
case Button1: case Button1:
com = options->commandWindow1(); com = options->commandWindow1();
@ -1513,7 +1513,7 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int
if ( (state & ( Button1Mask & Button2Mask & Button3Mask )) == 0 ) if ( (state & ( Button1Mask & Button2Mask & Button3Mask )) == 0 )
{ {
buttonDown = FALSE; buttonDown = FALSE;
if ( moveResizeMode ) if ( moveResizeMode )
{ {
finishMoveResize( false ); finishMoveResize( false );
// mouse position is still relative to old Client position, adjust it // mouse position is still relative to old Client position, adjust it
@ -1564,7 +1564,7 @@ bool Client::motionNotifyEvent( Window w, int /*state*/, int x, int y, int x_roo
{ {
if( w != frameId() && w != decorationId() && w != moveResizeGrabWindow()) if( w != frameId() && w != decorationId() && w != moveResizeGrabWindow())
return true; // care only about the whole frame return true; // care only about the whole frame
if ( !buttonDown ) if ( !buttonDown )
{ {
Position newmode = mousePosition( TQPoint( x, y )); Position newmode = mousePosition( TQPoint( x, y ));
if( newmode != mode ) if( newmode != mode )
@ -1682,7 +1682,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
buttonDown = FALSE; buttonDown = FALSE;
setCursor( mode ); setCursor( mode );
} }
else if( direction >= NET::TopLeft && direction <= NET::Left ) else if( direction >= NET::TopLeft && direction <= NET::Left )
{ {
static const Position convert[] = static const Position convert[] =
{ {
@ -1733,7 +1733,7 @@ void Client::keyPressEvent( uint key_code )
key_code = key_code & 0xffff; key_code = key_code & 0xffff;
int delta = is_control?1:is_alt?32:8; int delta = is_control?1:is_alt?32:8;
TQPoint pos = TQCursor::pos(); TQPoint pos = TQCursor::pos();
switch ( key_code ) switch ( key_code )
{ {
case Key_Left: case Key_Left:
pos.rx() -= delta; pos.rx() -= delta;

@ -1899,7 +1899,7 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
if( horizontal ) if( horizontal )
max_mode = MaximizeMode( max_mode ^ MaximizeHorizontal ); max_mode = MaximizeMode( max_mode ^ MaximizeHorizontal );
} }
max_mode = rules()->checkMaximize( max_mode ); max_mode = rules()->checkMaximize( max_mode );
if( !adjust && max_mode == old_mode ) if( !adjust && max_mode == old_mode )
return; return;
@ -1948,9 +1948,9 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
{ {
max_mode = MaximizeHorizontal; max_mode = MaximizeHorizontal;
maxmode_restore = MaximizeRestore; maxmode_restore = MaximizeRestore;
} }
} }
switch (max_mode) switch (max_mode)
{ {
@ -2476,7 +2476,7 @@ void Client::checkUnrestrictedMoveResize()
return; return;
TQRect desktopArea = workspace()->clientArea( WorkArea, moveResizeGeom.center(), desktop()); TQRect desktopArea = workspace()->clientArea( WorkArea, moveResizeGeom.center(), desktop());
int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge;
// restricted move/resize - keep at least part of the titlebar always visible // restricted move/resize - keep at least part of the titlebar always visible
// how much must remain visible when moved away in that direction // how much must remain visible when moved away in that direction
left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); left_marge = KMIN( 100 + border_right, moveResizeGeom.width());
right_marge = KMIN( 100 + border_left, moveResizeGeom.width()); right_marge = KMIN( 100 + border_left, moveResizeGeom.width());
@ -2552,7 +2552,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root )
int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge;
if( unrestrictedMoveResize ) // unrestricted, just don't let it go out completely if( unrestrictedMoveResize ) // unrestricted, just don't let it go out completely
left_marge = right_marge = top_marge = bottom_marge = titlebar_marge = 5; left_marge = right_marge = top_marge = bottom_marge = titlebar_marge = 5;
else // restricted move/resize - keep at least part of the titlebar always visible else // restricted move/resize - keep at least part of the titlebar always visible
{ {
// how much must remain visible when moved away in that direction // how much must remain visible when moved away in that direction
left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); left_marge = KMIN( 100 + border_right, moveResizeGeom.width());

@ -233,7 +233,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par
"in the Notifications control module.</p>" ); "in the Notifications control module.</p>" );
TQWhatsThis::add( focusStealing, wtstr ); TQWhatsThis::add( focusStealing, wtstr );
TQWhatsThis::add( focusStealingLabel, wtstr ); TQWhatsThis::add( focusStealingLabel, wtstr );
TQWhatsThis::add( autoRaiseOn, i18n("When this option is enabled, a window in the background will automatically" TQWhatsThis::add( autoRaiseOn, i18n("When this option is enabled, a window in the background will automatically"
" come to the front when the mouse pointer has been over it for some time.") ); " come to the front when the mouse pointer has been over it for some time.") );
wtstr = i18n("This is the delay after which the window that the mouse pointer is over will automatically" wtstr = i18n("This is the delay after which the window that the mouse pointer is over will automatically"
@ -265,7 +265,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par
connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateActiveMouseScreen())); connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateActiveMouseScreen()));
if (!TQApplication::desktop()->isVirtualDesktop() || if (!TQApplication::desktop()->isVirtualDesktop() ||
TQApplication::desktop()->numScreens() == 1) // No Ximerama TQApplication::desktop()->numScreens() == 1) // No Ximerama
{ {
separateScreenFocus->hide(); separateScreenFocus->hide();
activeMouseScreen->hide(); activeMouseScreen->hide();
@ -498,7 +498,7 @@ void KFocusConfig::load( void )
setClickRaise(key != "off"); setClickRaise(key != "off");
setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click
setDelayFocusEnabled(); setDelayFocusEnabled();
setSeparateScreenFocus( config->readBoolEntry(KWIN_SEPARATE_SCREEN_FOCUS, false)); setSeparateScreenFocus( config->readBoolEntry(KWIN_SEPARATE_SCREEN_FOCUS, false));
// on by default for non click to focus policies // on by default for non click to focus policies
setActiveMouseScreen( config->readBoolEntry(KWIN_ACTIVE_MOUSE_SCREEN, focusCombo->currentItem() != 0 )); setActiveMouseScreen( config->readBoolEntry(KWIN_ACTIVE_MOUSE_SCREEN, focusCombo->currentItem() != 0 ));
@ -1428,12 +1428,12 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config,
TQWidget *tGroup = new TQWidget(tabW); TQWidget *tGroup = new TQWidget(tabW);
TQVBoxLayout *vLay = new TQVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint()); TQVBoxLayout *vLay = new TQVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint());
vLay->addSpacing(11); // to get the proper gb top offset vLay->addSpacing(11); // to get the proper gb top offset
onlyDecoTranslucent = new TQCheckBox(i18n("Apply translucency only to decoration"),tGroup); onlyDecoTranslucent = new TQCheckBox(i18n("Apply translucency only to decoration"),tGroup);
vLay->addWidget(onlyDecoTranslucent); vLay->addWidget(onlyDecoTranslucent);
vLay->addSpacing(11); vLay->addSpacing(11);
TQGridLayout *gLay = new TQGridLayout(vLay,4,2,KDialog::spacingHint()); TQGridLayout *gLay = new TQGridLayout(vLay,4,2,KDialog::spacingHint());
gLay->setColStretch(1,1); gLay->setColStretch(1,1);

@ -276,11 +276,11 @@ class KTranslucencyConfig : public TDECModule
public: public:
KTranslucencyConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 ); KTranslucencyConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 );
~KTranslucencyConfig(); ~KTranslucencyConfig();
void load(); void load();
void save(); void save();
void defaults(); void defaults();
private: private:
TQCheckBox *useTranslucency; TQCheckBox *useTranslucency;
TQCheckBox *activeWindowTransparency; TQCheckBox *activeWindowTransparency;

@ -424,7 +424,7 @@ void Workspace::raiseClientWithinApplication( Client* c )
StackingUpdatesBlocker blocker( this ); StackingUpdatesBlocker blocker( this );
// ignore mainwindows // ignore mainwindows
// first try to put it above the top-most window of the application // first try to put it above the top-most window of the application
for( ClientList::Iterator it = unconstrained_stacking_order.fromLast(); for( ClientList::Iterator it = unconstrained_stacking_order.fromLast();
it != unconstrained_stacking_order.end(); it != unconstrained_stacking_order.end();
@ -596,10 +596,10 @@ ClientList Workspace::constrainedStackingOrder()
minimum_layer[ (*it)->group() ] = l; minimum_layer[ (*it)->group() ] = l;
layer[ l ].append( *it ); layer[ l ].append( *it );
} }
ClientList stacking; ClientList stacking;
for( Layer lay = FirstLayer; for( Layer lay = FirstLayer;
lay < NumLayers; lay < NumLayers;
++lay ) ++lay )
stacking += layer[ lay ]; stacking += layer[ lay ];
#if 0 #if 0
kdDebug() << "stacking2:" << endl; kdDebug() << "stacking2:" << endl;
@ -757,7 +757,7 @@ void Client::restackWindow( Window /*above TODO */, int detail, NET::RequestSour
if( send_event ) if( send_event )
sendSyntheticConfigureNotify(); sendSyntheticConfigureNotify();
} }
void Client::setKeepAbove( bool b ) void Client::setKeepAbove( bool b )
{ {
b = rules()->checkKeepAbove( b ); b = rules()->checkKeepAbove( b );

@ -110,16 +110,19 @@ enum ShadeMode
enum ActiveBorder enum ActiveBorder
{ {
ActiveTop, ActiveNone = 0,
ActiveTopRight,
ActiveRight, ActiveLeft = 1,
ActiveBottomRight, ActiveRight = 2,
ActiveBottom, ActiveTop = 4,
ActiveBottomLeft, ActiveBottom = 8,
ActiveLeft,
ActiveTopLeft, ActiveTopLeft = ActiveTop | ActiveLeft,
ACTIVE_BORDER_COUNT, ActiveTopRight = ActiveTop | ActiveRight,
ActiveNone ActiveBottomLeft = ActiveBottom | ActiveLeft,
ActiveBottomRight = ActiveBottom | ActiveRight,
ACTIVE_BORDER_COUNT
}; };
enum ActiveMaximizingMode enum ActiveMaximizingMode
@ -129,7 +132,7 @@ enum ActiveMaximizingMode
ActiveMaximizeMode ActiveMaximizeMode
}; };
class Shape class Shape
{ {
public: public:
static bool available() { return twin_shape_version > 0; } static bool available() { return twin_shape_version > 0; }
@ -147,12 +150,12 @@ class Shape
const int ShapeInput = 2; const int ShapeInput = 2;
#endif #endif
class Motif class Motif
{ {
public: public:
static void readFlags( WId w, bool& noborder, bool& resize, bool& move, static void readFlags( WId w, bool& noborder, bool& resize, bool& move,
bool& minimize, bool& maximize, bool& close ); bool& minimize, bool& maximize, bool& close );
struct MwmHints struct MwmHints
{ {
ulong flags; ulong flags;
ulong functions; ulong functions;
@ -248,7 +251,7 @@ KWIN_CHECK_PREDICATE( TruePredicate, cl == cl /*true, avoid warning about 'cl' *
template< typename T > template< typename T >
Client* findClientInList( const ClientList& list, T predicate ) Client* findClientInList( const ClientList& list, T predicate )
{ {
for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it) for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it)
{ {
if ( predicate( const_cast< const Client* >( *it))) if ( predicate( const_cast< const Client* >( *it)))
return *it; return *it;

@ -201,8 +201,8 @@ Workspace::Workspace( bool restore )
updateXTime(); // needed for proper initialization of user_time in Client ctor updateXTime(); // needed for proper initialization of user_time in Client ctor
delayFocusTimer = 0; delayFocusTimer = 0;
active_time_first = GET_QT_X_TIME(); active_time_first = GET_QT_X_TIME();
active_time_last = GET_QT_X_TIME(); active_time_last = GET_QT_X_TIME();
@ -315,7 +315,7 @@ void Workspace::init()
// not used yet // not used yet
// topDock = 0L; // topDock = 0L;
// maximizedWindowCounter = 0; // maximizedWindowCounter = 0;
supportWindow = new TQWidget; supportWindow = new TQWidget;
XLowerWindow( tqt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp XLowerWindow( tqt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp
@ -461,7 +461,7 @@ void Workspace::init()
unsigned int i, nwins; unsigned int i, nwins;
Window root_return, parent_return, *wins; Window root_return, parent_return, *wins;
XQueryTree(tqt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins); XQueryTree(tqt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins);
for (i = 0; i < nwins; i++) for (i = 0; i < nwins; i++)
{ {
XWindowAttributes attr; XWindowAttributes attr;
XGetWindowAttributes(tqt_xdisplay(), wins[i], &attr); XGetWindowAttributes(tqt_xdisplay(), wins[i], &attr);
@ -469,12 +469,12 @@ void Workspace::init()
continue; continue;
if( topmenu_space && topmenu_space->winId() == wins[ i ] ) if( topmenu_space && topmenu_space->winId() == wins[ i ] )
continue; continue;
if (attr.map_state != IsUnmapped) if (attr.map_state != IsUnmapped)
{ {
if ( addSystemTrayWin( wins[i] ) ) if ( addSystemTrayWin( wins[i] ) )
continue; continue;
Client* c = createClient( wins[i], true ); Client* c = createClient( wins[i], true );
if ( c != NULL && root != tqt_xrootwin() ) if ( c != NULL && root != tqt_xrootwin() )
{ // TODO what is this? { // TODO what is this?
// TODO may use TQWidget:.create // TODO may use TQWidget:.create
XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 ); XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 );
@ -810,7 +810,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
void Workspace::updateOverlappingShadows(unsigned long window) void Workspace::updateOverlappingShadows(unsigned long window)
{ {
Client *client; Client *client;
if ((client = findClient(WindowMatchPredicate((WId)window)))) if ((client = findClient(WindowMatchPredicate((WId)window))))
// Redraw overlapping shadows without waiting for the specified window // Redraw overlapping shadows without waiting for the specified window
// to redraw its own shadow // to redraw its own shadow
@ -820,7 +820,7 @@ void Workspace::updateOverlappingShadows(unsigned long window)
void Workspace::setShadowed(unsigned long window, bool shadowed) void Workspace::setShadowed(unsigned long window, bool shadowed)
{ {
Client *client; Client *client;
if ((client = findClient(WindowMatchPredicate((WId)window)))) if ((client = findClient(WindowMatchPredicate((WId)window))))
client->setShadowed(shadowed); client->setShadowed(shadowed);
} }
@ -916,7 +916,7 @@ void Workspace::updateCurrentTopMenu()
} }
// ... then hide the other ones. Avoids flickers. // ... then hide the other ones. Avoids flickers.
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it)
{ {
if( (*it)->isTopMenu() && (*it) != menubar ) if( (*it)->isTopMenu() && (*it) != menubar )
(*it)->hideClient( true ); (*it)->hideClient( true );
@ -1033,7 +1033,7 @@ void Workspace::updateColormap()
Colormap cmap = default_colormap; Colormap cmap = default_colormap;
if ( activeClient() && activeClient()->colormap() != None ) if ( activeClient() && activeClient()->colormap() != None )
cmap = activeClient()->colormap(); cmap = activeClient()->colormap();
if ( cmap != installed_colormap ) if ( cmap != installed_colormap )
{ {
XInstallColormap(tqt_xdisplay(), cmap ); XInstallColormap(tqt_xdisplay(), cmap );
installed_colormap = cmap; installed_colormap = cmap;
@ -1228,7 +1228,7 @@ void Workspace::loadDesktopSettings()
desktop_focus_chain.resize( n ); desktop_focus_chain.resize( n );
// make it +1, so that it can be accessed as [1..numberofdesktops] // make it +1, so that it can be accessed as [1..numberofdesktops]
focus_chain.resize( n + 1 ); focus_chain.resize( n + 1 );
for(int i = 1; i <= n; i++) for(int i = 1; i <= n; i++)
{ {
TQString s = c->readEntry(TQString("Name_%1").arg(i), TQString s = c->readEntry(TQString("Name_%1").arg(i),
i18n("Desktop %1").arg(i)); i18n("Desktop %1").arg(i));
@ -1248,21 +1248,21 @@ void Workspace::saveDesktopSettings()
TDEConfigGroupSaver saver(c,groupname); TDEConfigGroupSaver saver(c,groupname);
c->writeEntry("Number", number_of_desktops ); c->writeEntry("Number", number_of_desktops );
for(int i = 1; i <= number_of_desktops; i++) for(int i = 1; i <= number_of_desktops; i++)
{ {
TQString s = desktopName( i ); TQString s = desktopName( i );
TQString defaultvalue = i18n("Desktop %1").arg(i); TQString defaultvalue = i18n("Desktop %1").arg(i);
if ( s.isEmpty() ) if ( s.isEmpty() )
{ {
s = defaultvalue; s = defaultvalue;
rootInfo->setDesktopName( i, s.utf8().data() ); rootInfo->setDesktopName( i, s.utf8().data() );
} }
if (s != defaultvalue) if (s != defaultvalue)
{ {
c->writeEntry( TQString("Name_%1").arg(i), s ); c->writeEntry( TQString("Name_%1").arg(i), s );
} }
else else
{ {
TQString currentvalue = c->readEntry(TQString("Name_%1").arg(i)); TQString currentvalue = c->readEntry(TQString("Name_%1").arg(i));
if (currentvalue != defaultvalue) if (currentvalue != defaultvalue)
@ -1300,10 +1300,10 @@ void Workspace::doNotManage( TQString title )
*/ */
bool Workspace::isNotManaged( const TQString& title ) bool Workspace::isNotManaged( const TQString& title )
{ {
for ( TQStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it ) for ( TQStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it )
{ {
TQRegExp r( (*it) ); TQRegExp r( (*it) );
if (r.search(title) != -1) if (r.search(title) != -1)
{ {
doNotManageList.remove( it ); doNotManageList.remove( it );
return TRUE; return TRUE;
@ -1315,7 +1315,7 @@ bool Workspace::isNotManaged( const TQString& title )
/*! /*!
Refreshes all the client windows Refreshes all the client windows
*/ */
void Workspace::refresh() void Workspace::refresh()
{ {
TQWidget w; TQWidget w;
w.setGeometry( TQApplication::desktop()->geometry() ); w.setGeometry( TQApplication::desktop()->geometry() );
@ -1352,7 +1352,7 @@ void ObscuringWindows::create( Client* c )
Window obs_win; Window obs_win;
XWindowChanges chngs; XWindowChanges chngs;
int mask = CWSibling | CWStackMode; int mask = CWSibling | CWStackMode;
if( cached->count() > 0 ) if( cached->count() > 0 )
{ {
cached->remove( obs_win = cached->first()); cached->remove( obs_win = cached->first());
chngs.x = c->x(); chngs.x = c->x();
@ -1361,7 +1361,7 @@ void ObscuringWindows::create( Client* c )
chngs.height = c->height(); chngs.height = c->height();
mask |= CWX | CWY | CWWidth | CWHeight; mask |= CWX | CWY | CWWidth | CWHeight;
} }
else else
{ {
XSetWindowAttributes a; XSetWindowAttributes a;
a.background_pixmap = None; a.background_pixmap = None;
@ -1382,7 +1382,7 @@ ObscuringWindows::~ObscuringWindows()
max_cache_size = TQMAX( max_cache_size, obscuring_windows.count() + 4 ) - 1; max_cache_size = TQMAX( max_cache_size, obscuring_windows.count() + 4 ) - 1;
for( TQValueList<Window>::ConstIterator it = obscuring_windows.begin(); for( TQValueList<Window>::ConstIterator it = obscuring_windows.begin();
it != obscuring_windows.end(); it != obscuring_windows.end();
++it ) ++it )
{ {
XUnmapWindow( tqt_xdisplay(), *it ); XUnmapWindow( tqt_xdisplay(), *it );
if( cached->count() < max_cache_size ) if( cached->count() < max_cache_size )
@ -1410,7 +1410,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
StackingUpdatesBlocker blocker( this ); StackingUpdatesBlocker blocker( this );
int old_desktop = current_desktop; int old_desktop = current_desktop;
if (new_desktop != current_desktop) if (new_desktop != current_desktop)
{ {
++block_showing_desktop; ++block_showing_desktop;
/* /*
@ -1449,7 +1449,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
} }
if (desktopHasCompositing) { if (desktopHasCompositing) {
// If composition is in use then we cannot hide the old windows before showing the new ones, // If composition is in use then we cannot hide the old windows before showing the new ones,
// unless you happen to like the "flicker annoyingly to desktop" effect... :-P // unless you happen to like the "flicker annoyingly to desktop" effect... :-P
XSync( tqt_xdisplay(), false); // Make absolutely certain all new windows are shown before hiding the old ones XSync( tqt_xdisplay(), false); // Make absolutely certain all new windows are shown before hiding the old ones
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) { for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) {
@ -1472,7 +1472,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
--block_focus; --block_focus;
Client* c = 0; Client* c = 0;
if ( options->focusPolicyIsReasonable()) if ( options->focusPolicyIsReasonable())
{ {
// Search in focus chain // Search in focus chain
if ( movingClient != NULL && active_client == movingClient if ( movingClient != NULL && active_client == movingClient
@ -1481,7 +1481,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
{ {
c = active_client; // the requestFocus below will fail, as the client is already active c = active_client; // the requestFocus below will fail, as the client is already active
} }
if ( !c ) if ( !c )
{ {
for( ClientList::ConstIterator it = focus_chain[currentDesktop()].fromLast(); for( ClientList::ConstIterator it = focus_chain[currentDesktop()].fromLast();
it != focus_chain[currentDesktop()].end(); it != focus_chain[currentDesktop()].end();
@ -1508,9 +1508,9 @@ bool Workspace::setCurrentDesktop( int new_desktop )
if( c != active_client ) if( c != active_client )
setActiveClient( NULL, Allowed ); setActiveClient( NULL, Allowed );
if ( c ) if ( c )
requestFocus( c ); requestFocus( c );
else else
focusToNull(); focusToNull();
updateCurrentTopMenu(); updateCurrentTopMenu();
@ -1556,7 +1556,7 @@ int Workspace::desktopToRight( int desktop ) const
if (layoutOrientation == Qt::Vertical) if (layoutOrientation == Qt::Vertical)
{ {
dt += y; dt += y;
if ( dt >= numberOfDesktops() ) if ( dt >= numberOfDesktops() )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
dt -= numberOfDesktops(); dt -= numberOfDesktops();
@ -1567,7 +1567,7 @@ int Workspace::desktopToRight( int desktop ) const
else else
{ {
int d = (dt % x) + 1; int d = (dt % x) + 1;
if ( d >= x ) if ( d >= x )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
d -= x; d -= x;
@ -1587,7 +1587,7 @@ int Workspace::desktopToLeft( int desktop ) const
if (layoutOrientation == Qt::Vertical) if (layoutOrientation == Qt::Vertical)
{ {
dt -= y; dt -= y;
if ( dt < 0 ) if ( dt < 0 )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
dt += numberOfDesktops(); dt += numberOfDesktops();
@ -1598,7 +1598,7 @@ int Workspace::desktopToLeft( int desktop ) const
else else
{ {
int d = (dt % x) - 1; int d = (dt % x) - 1;
if ( d < 0 ) if ( d < 0 )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
d += x; d += x;
@ -1618,7 +1618,7 @@ int Workspace::desktopUp( int desktop ) const
if (layoutOrientation == Qt::Horizontal) if (layoutOrientation == Qt::Horizontal)
{ {
dt -= x; dt -= x;
if ( dt < 0 ) if ( dt < 0 )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
dt += numberOfDesktops(); dt += numberOfDesktops();
@ -1629,7 +1629,7 @@ int Workspace::desktopUp( int desktop ) const
else else
{ {
int d = (dt % y) - 1; int d = (dt % y) - 1;
if ( d < 0 ) if ( d < 0 )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
d += y; d += y;
@ -1649,7 +1649,7 @@ int Workspace::desktopDown( int desktop ) const
if (layoutOrientation == Qt::Horizontal) if (layoutOrientation == Qt::Horizontal)
{ {
dt += x; dt += x;
if ( dt >= numberOfDesktops() ) if ( dt >= numberOfDesktops() )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
dt -= numberOfDesktops(); dt -= numberOfDesktops();
@ -1660,7 +1660,7 @@ int Workspace::desktopDown( int desktop ) const
else else
{ {
int d = (dt % y) + 1; int d = (dt % y) + 1;
if ( d >= y ) if ( d >= y )
{ {
if ( options->rollOverDesktops ) if ( options->rollOverDesktops )
d -= y; d -= y;
@ -1688,7 +1688,7 @@ void Workspace::setNumberOfDesktops( int n )
// if increasing the number, do the resizing now, // if increasing the number, do the resizing now,
// otherwise after the moving of windows to still existing desktops // otherwise after the moving of windows to still existing desktops
if( old_number_of_desktops < number_of_desktops ) if( old_number_of_desktops < number_of_desktops )
{ {
rootInfo->setNumberOfDesktops( number_of_desktops ); rootInfo->setNumberOfDesktops( number_of_desktops );
NETPoint* viewports = new NETPoint[ number_of_desktops ]; NETPoint* viewports = new NETPoint[ number_of_desktops ];
@ -1700,17 +1700,17 @@ void Workspace::setNumberOfDesktops( int n )
// if the number of desktops decreased, move all // if the number of desktops decreased, move all
// windows that would be hidden to the last visible desktop // windows that would be hidden to the last visible desktop
if( old_number_of_desktops > number_of_desktops ) if( old_number_of_desktops > number_of_desktops )
{ {
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.begin();
it != clients.end(); it != clients.end();
++it) ++it)
{ {
if( !(*it)->isOnAllDesktops() && (*it)->desktop() > numberOfDesktops()) if( !(*it)->isOnAllDesktops() && (*it)->desktop() > numberOfDesktops())
sendClientToDesktop( *it, numberOfDesktops(), true ); sendClientToDesktop( *it, numberOfDesktops(), true );
} }
} }
if( old_number_of_desktops > number_of_desktops ) if( old_number_of_desktops > number_of_desktops )
{ {
rootInfo->setNumberOfDesktops( number_of_desktops ); rootInfo->setNumberOfDesktops( number_of_desktops );
NETPoint* viewports = new NETPoint[ number_of_desktops ]; NETPoint* viewports = new NETPoint[ number_of_desktops ];
@ -1750,7 +1750,7 @@ void Workspace::sendClientToDesktop( Client* c, int desk, bool dont_activate )
else else
restackClientUnderActive( c ); restackClientUnderActive( c );
} }
else else
{ {
raiseClient( c ); raiseClient( c );
} }
@ -1937,7 +1937,7 @@ void Workspace::propagateSystemTrayWins()
Window *cl = new Window[ systemTrayWins.count()]; Window *cl = new Window[ systemTrayWins.count()];
int i = 0; int i = 0;
for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it )
{ {
cl[i++] = (*it).win; cl[i++] = (*it).win;
} }
@ -1953,7 +1953,7 @@ void Workspace::killWindowId( Window window_to_kill )
return; return;
Window window = window_to_kill; Window window = window_to_kill;
Client* client = NULL; Client* client = NULL;
for(;;) for(;;)
{ {
client = findClient( FrameIdMatchPredicate( window )); client = findClient( FrameIdMatchPredicate( window ));
if( client != NULL ) // found the client if( client != NULL ) // found the client
@ -2086,12 +2086,12 @@ void Workspace::sendTakeActivity( Client* c, Time timestamp, long flags )
*/ */
void Workspace::slotGrabWindow() void Workspace::slotGrabWindow()
{ {
if ( active_client ) if ( active_client )
{ {
TQPixmap snapshot = TQPixmap::grabWindow( active_client->frameId() ); TQPixmap snapshot = TQPixmap::grabWindow( active_client->frameId() );
//No XShape - no work. //No XShape - no work.
if( Shape::available()) if( Shape::available())
{ {
//As the first step, get the mask from XShape. //As the first step, get the mask from XShape.
int count, order; int count, order;
@ -2101,7 +2101,7 @@ void Workspace::slotGrabWindow()
//ShapeBounding - ShapeClipping is defined to be the border. //ShapeBounding - ShapeClipping is defined to be the border.
//Since the border area is part of the window, we use bounding //Since the border area is part of the window, we use bounding
// to limit our work region // to limit our work region
if (rects) if (rects)
{ {
//Create a TQRegion from the rectangles describing the bounding mask. //Create a TQRegion from the rectangles describing the bounding mask.
TQRegion contents; TQRegion contents;
@ -2152,7 +2152,7 @@ void Workspace::slotGrabDesktop()
void Workspace::slotMouseEmulation() void Workspace::slotMouseEmulation()
{ {
if ( mouse_emulation ) if ( mouse_emulation )
{ {
XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME());
mouse_emulation = FALSE; mouse_emulation = FALSE;
@ -2162,7 +2162,7 @@ void Workspace::slotMouseEmulation()
if ( XGrabKeyboard(tqt_xdisplay(), if ( XGrabKeyboard(tqt_xdisplay(),
root, FALSE, root, FALSE,
GrabModeAsync, GrabModeAsync, GrabModeAsync, GrabModeAsync,
GET_QT_X_TIME()) == GrabSuccess ) GET_QT_X_TIME()) == GrabSuccess )
{ {
mouse_emulation = TRUE; mouse_emulation = TRUE;
mouse_emulation_state = 0; mouse_emulation_state = 0;
@ -2184,7 +2184,7 @@ WId Workspace::getMouseEmulationWindow()
uint state; uint state;
Window w; Window w;
Client * c = 0; Client * c = 0;
do do
{ {
w = child; w = child;
if (!c) if (!c)
@ -2206,12 +2206,12 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
if ( !w ) if ( !w )
return state; return state;
TQWidget* widget = TQWidget::find( w ); TQWidget* widget = TQWidget::find( w );
if ( (!widget || widget->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) ) && !findClient( WindowMatchPredicate( w )) ) if ( (!widget || widget->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) ) && !findClient( WindowMatchPredicate( w )) )
{ {
int x, y; int x, y;
Window xw; Window xw;
XTranslateCoordinates( tqt_xdisplay(), tqt_xrootwin(), w, pos.x(), pos.y(), &x, &y, &xw ); XTranslateCoordinates( tqt_xdisplay(), tqt_xrootwin(), w, pos.x(), pos.y(), &x, &y, &xw );
if ( type == EmuMove ) if ( type == EmuMove )
{ // motion notify events { // motion notify events
XEvent e; XEvent e;
e.type = MotionNotify; e.type = MotionNotify;
@ -2227,7 +2227,7 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xmotion.is_hint = NotifyNormal; e.xmotion.is_hint = NotifyNormal;
XSendEvent( tqt_xdisplay(), w, TRUE, ButtonMotionMask, &e ); XSendEvent( tqt_xdisplay(), w, TRUE, ButtonMotionMask, &e );
} }
else else
{ {
XEvent e; XEvent e;
e.type = type == EmuRelease ? ButtonRelease : ButtonPress; e.type = type == EmuRelease ? ButtonRelease : ButtonPress;
@ -2243,9 +2243,9 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
e.xbutton.button = button; e.xbutton.button = button;
XSendEvent( tqt_xdisplay(), w, TRUE, ButtonPressMask, &e ); XSendEvent( tqt_xdisplay(), w, TRUE, ButtonPressMask, &e );
if ( type == EmuPress ) if ( type == EmuPress )
{ {
switch ( button ) switch ( button )
{ {
case 2: case 2:
state |= Button2Mask; state |= Button2Mask;
@ -2258,9 +2258,9 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation
break; break;
} }
} }
else else
{ {
switch ( button ) switch ( button )
{ {
case 2: case 2:
state &= ~Button2Mask; state &= ~Button2Mask;
@ -2294,7 +2294,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
int delta = is_control?1:is_alt?32:8; int delta = is_control?1:is_alt?32:8;
TQPoint pos = TQCursor::pos(); TQPoint pos = TQCursor::pos();
switch ( kc ) switch ( kc )
{ {
case XK_Left: case XK_Left:
case XK_KP_Left: case XK_KP_Left:
@ -2339,16 +2339,16 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
case XK_Return: case XK_Return:
case XK_space: case XK_space:
case XK_KP_Enter: case XK_KP_Enter:
case XK_KP_Space: case XK_KP_Space:
{ {
if ( !mouse_emulation_state ) if ( !mouse_emulation_state )
{ {
// nothing was pressed, fake a LMB click // nothing was pressed, fake a LMB click
mouse_emulation_window = getMouseEmulationWindow(); mouse_emulation_window = getMouseEmulationWindow();
mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuPress, Button1, mouse_emulation_state ); mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuPress, Button1, mouse_emulation_state );
mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state ); mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state );
} }
else else
{ // release all { // release all
if ( mouse_emulation_state & Button1Mask ) if ( mouse_emulation_state & Button1Mask )
mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state ); mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state );
@ -2534,8 +2534,9 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
have_borders = true; have_borders = true;
} }
} }
if( !have_borders ) if (!have_borders) {
return; return;
}
// Mouse should not move more than this many pixels // Mouse should not move more than this many pixels
int distance_reset = activation_distance + 10; int distance_reset = activation_distance + 10;
@ -2575,49 +2576,37 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
active_qtop = pos.y() < activeTop + active_height_quart, active_qtop = pos.y() < activeTop + active_height_quart,
active_qbottom = pos.y() > activeBottom - active_height_quart; active_qbottom = pos.y() > activeBottom - active_height_quart;
if (!active_left && !active_right && !active_top && !active_bottom) int border = ActiveNone;
return;
kdDebug() << "active border activated " if (active_left) border |= ActiveLeft;
<< pos.x() << ":" << pos.y() << endl; if (active_right) border |= ActiveRight;
if (active_top) border |= ActiveTop;
if (active_bottom) border |= ActiveBottom;
ActiveBorder border = ActiveNone; if (border == ActiveLeft || border == ActiveRight) {
if (active_left && active_top) { if (active_qtop) border |= ActiveTop;
border = ActiveTopLeft; if (active_qbottom) border |= ActiveBottom;
}
else if (active_right && active_top) {
border = ActiveTopRight;
}
else if (active_left && active_bottom) {
border = ActiveBottomLeft;
} }
else if (active_right && active_bottom) {
border = ActiveBottomRight; else if (border == ActiveTop || border == ActiveBottom) {
} if (active_qleft) border |= ActiveLeft;
else if (active_left) { if (active_qright) border |= ActiveRight;
border = active_qtop ? ActiveTopLeft
: (active_qbottom ? ActiveBottomLeft
: ActiveLeft);
}
else if (active_right) {
border = active_qtop ? ActiveTopRight
: (active_qbottom ? ActiveBottomRight
: ActiveRight);
} }
else if (active_top) {
border = active_qleft ? ActiveTopLeft bool border_valid = false;
: (active_qright ? ActiveTopRight for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) {
: ActiveTop); if (border == (ActiveBorder)i) {
border_valid = true;
}
} }
else if (active_bottom) {
border = active_qleft ? ActiveBottomLeft if (!border_valid) {
: (active_qright ? ActiveBottomRight abort();
: ActiveBottom);
} }
else abort();
if( active_windows[border] == None ) if (border == ActiveNone || active_windows[border] == None) {
return; return;
}
if ((active_current_border == border) && if ((active_current_border == border) &&
(timestampDiff(active_time_last, now) < treshold_reset) && (timestampDiff(active_time_last, now) < treshold_reset) &&
@ -2625,10 +2614,6 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
((pos-active_push_point).manhattanLength() < distance_reset)) ((pos-active_push_point).manhattanLength() < distance_reset))
{ {
active_time_last = now; active_time_last = now;
kdDebug() << "time diff between first time and now is: "
<< timestampDiff(active_time_first, now)
<< " vs threshold " << treshold_set << endl;
if (timestampDiff(active_time_first, now) > treshold_set) if (timestampDiff(active_time_first, now) > treshold_set)
{ {
active_time_last_trigger = now; active_time_last_trigger = now;
@ -2642,7 +2627,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
if (options->activeBorders() == Options::ActiveSwitchAlways || if (options->activeBorders() == Options::ActiveSwitchAlways ||
options->activeBorders() == Options::ActiveSwitchOnMove) options->activeBorders() == Options::ActiveSwitchOnMove)
{ {
activeBorderSwitchDesktop(border, pos); activeBorderSwitchDesktop((ActiveBorder)border, pos);
return; // Don't reset cursor position return; // Don't reset cursor position
} }
@ -2662,7 +2647,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
{ {
if (!movingClient->isResizable()) return; if (!movingClient->isResizable()) return;
movingClient->setActiveBorderMode(ActiveTilingMode); movingClient->setActiveBorderMode(ActiveTilingMode);
movingClient->setActiveBorder(border); movingClient->setActiveBorder((ActiveBorder)border);
movingClient->setActiveBorderMaximizing(true); movingClient->setActiveBorderMaximizing(true);
} }
@ -2676,7 +2661,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
// Desktop switching // Desktop switching
if (options->activeBorders() == Options::ActiveSwitchAlways && isSide) if (options->activeBorders() == Options::ActiveSwitchAlways && isSide)
{ {
activeBorderSwitchDesktop(border, pos); activeBorderSwitchDesktop((ActiveBorder)border, pos);
return; // Don't reset cursor position return; // Don't reset cursor position
} }
} }
@ -2684,7 +2669,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
} }
else else
{ {
active_current_border = border; active_current_border = (ActiveBorder)border;
active_time_first = now; active_time_first = now;
active_time_last = now; active_time_last = now;
active_push_point = pos; active_push_point = pos;
@ -2693,11 +2678,11 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now)
if ((options->activeBorders() == Options::ActiveSwitchAlways && !movingClient) || if ((options->activeBorders() == Options::ActiveSwitchAlways && !movingClient) ||
activation_distance < 2) activation_distance < 2)
{ {
// reset the pointer to find out whether the user is really pushing // Reset the pointer to find out whether the user is really pushing
// (the direction back from which it came, starting from top clockwise) // (ordered according to enum ActiveBorder minus ActiveNone)
const int xdiff[ ACTIVE_BORDER_COUNT ] = { 0, -1, -1, -1, 0, 1, 1, 1 }; const int xdiff[ACTIVE_BORDER_COUNT] = {1, -1, 0, 0, 1, -1, 1, -1};
const int ydiff[ ACTIVE_BORDER_COUNT ] = { 1, 1, 0, -1, -1, -1, 0, 1 }; const int ydiff[ACTIVE_BORDER_COUNT] = {0, 0, 1, -1, 1, 1, -1, -1};
TQCursor::setPos(pos.x() + xdiff[border], pos.y() + ydiff[border]); TQCursor::setPos(pos.x() + xdiff[border - 1], pos.y() + ydiff[border - 1]);
} }
} }
@ -3113,8 +3098,8 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen)
proc.start(TDEProcess::DontCare); proc.start(TDEProcess::DontCare);
} }
} }
void Workspace::setOpacity(unsigned long winId, unsigned int opacityPercent) void Workspace::setOpacity(unsigned long winId, unsigned int opacityPercent)
{ {
if (opacityPercent > 100) opacityPercent = 100; if (opacityPercent > 100) opacityPercent = 100;

@ -170,7 +170,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
*/ */
int numberOfDesktops() const; int numberOfDesktops() const;
void setNumberOfDesktops( int n ); void setNumberOfDesktops( int n );
int activeScreen() const; int activeScreen() const;
int numScreens() const; int numScreens() const;
void checkActiveScreen( const Client* c ); void checkActiveScreen( const Client* c );
@ -257,7 +257,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow() void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity() void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
bool kompmgrIsRunning(); bool kompmgrIsRunning();
void setOpacity(unsigned long winId, unsigned int opacityPercent); void setOpacity(unsigned long winId, unsigned int opacityPercent);
void setShadowSize(unsigned long winId, unsigned int shadowSizePercent); void setShadowSize(unsigned long winId, unsigned int shadowSizePercent);
@ -276,7 +276,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
void focusToNull(); // SELI public? void focusToNull(); // SELI public?
enum FocusChainChange { FocusChainMakeFirst, FocusChainMakeLast, FocusChainUpdate }; enum FocusChainChange { FocusChainMakeFirst, FocusChainMakeLast, FocusChainUpdate };
void updateFocusChains( Client* c, FocusChainChange change ); void updateFocusChains( Client* c, FocusChainChange change );
bool forcedGlobalMouseGrab() const; bool forcedGlobalMouseGrab() const;
void clientShortcutUpdated( Client* c ); void clientShortcutUpdated( Client* c );
bool shortcutAvailable( const TDEShortcut& cut, Client* ignore = NULL ) const; bool shortcutAvailable( const TDEShortcut& cut, Client* ignore = NULL ) const;
@ -390,7 +390,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
void setupWindowShortcutDone( bool ); void setupWindowShortcutDone( bool );
void updateClientArea(); void updateClientArea();
// kompmgr, also dcop // kompmgr, also dcop
void startKompmgr(); void startKompmgr();
@ -496,7 +496,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
void activeBorderSwitchDesktop(ActiveBorder border, const TQPoint& pos); void activeBorderSwitchDesktop(ActiveBorder border, const TQPoint& pos);
// ------------------ // ------------------
void helperDialog( const TQString& message, const Client* c ); void helperDialog( const TQString& message, const Client* c );
void calcDesktopLayout(int &x, int &y) const; void calcDesktopLayout(int &x, int &y) const;
@ -552,7 +552,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
ClientList global_focus_chain; // this one is only for things like tabbox's MRU ClientList global_focus_chain; // this one is only for things like tabbox's MRU
ClientList should_get_focus; // last is most recent ClientList should_get_focus; // last is most recent
ClientList attention_chain; ClientList attention_chain;
bool showing_desktop; bool showing_desktop;
ClientList showing_desktop_clients; ClientList showing_desktop_clients;
int block_showing_desktop; int block_showing_desktop;
@ -654,7 +654,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin
bool forced_global_mouse_grab; bool forced_global_mouse_grab;
friend class StackingUpdatesBlocker; friend class StackingUpdatesBlocker;
friend class Client; friend class Client;
//kompmgr //kompmgr
TQSlider *transSlider; TQSlider *transSlider;
TQPushButton *transButton; TQPushButton *transButton;

Loading…
Cancel
Save