diff --git a/twin/client.cpp b/twin/client.cpp index 484290e45..8c303ec15 100644 --- a/twin/client.cpp +++ b/twin/client.cpp @@ -178,7 +178,7 @@ Client::Client( Workspace *ws ) max_mode = MaximizeRestore; maxmode_restore = MaximizeRestore; - + cmap = None; 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 // 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; XDestroyWindow( tqt_xdisplay(), wrapper ); @@ -526,7 +526,7 @@ bool Client::isModalSystemNotification() const void Client::updateShape() { // workaround for #19644 - shaped windows shouldn't have decoration - if( shape() && !noBorder()) + if( shape() && !noBorder()) { noborder = true; updateDecoration( true ); @@ -605,7 +605,7 @@ TQRegion Client::mask() const return TQRegion( 0, 0, width(), height()); return _mask; } - + void Client::setShapable(bool b) { long tmp = b?1:0; @@ -747,12 +747,12 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) TQPixmap pm = animationPixmap( minimize ? width() : icongeom.width() ); TQRect before, after; - if ( minimize ) + if ( minimize ) { before = TQRect( x(), y(), 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() ); after = TQRect( x(), y(), width(), pm.height() ); @@ -776,14 +776,14 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) TQPainter p ( workspace()->desktopWidget() ); bool need_to_clear = FALSE; TQPixmap pm3; - do + do { if (area2 != area) { pm = animationPixmap( area.width() ); pm2 = TQPixmap::grabWindow( tqt_xrootwin(), area.x(), area.y(), area.width(), area.height() ); p.drawPixmap( area.x(), area.y(), pm ); - if ( need_to_clear ) + if ( need_to_clear ) { p.drawPixmap( area2.x(), area2.y(), pm3 ); need_to_clear = FALSE; @@ -799,11 +799,11 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) area.setRight(before.right() + int(diff*rf)); area.setTop(before.top() + int(diff*tf)); area.setBottom(before.bottom() + int(diff*bf)); - if (area2 != area ) + if (area2 != area ) { if ( area2.intersects( area ) ) p.drawPixmap( area2.x(), area2.y(), pm2 ); - else + else { // no overlap, we can clear later to avoid flicker pm3 = pm2; need_to_clear = TRUE; @@ -877,7 +877,7 @@ void Client::setShade( ShadeMode mode ) int as = options->animateShade? 10 : 1; // TODO all this unmapping, resizing etc. feels too much duplicated from elsewhere - if ( isShade()) + if ( isShade()) { // shade_mode == ShadeNormal // we're about to shade, texx xcompmgr to prepare long _shade = 1; @@ -891,13 +891,13 @@ void Client::setShade( ShadeMode mode ) XUnmapWindow( tqt_xdisplay(), wrapper ); XUnmapWindow( tqt_xdisplay(), client ); 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 // FRAME repaint( FALSE ); // bool wasStaticContents = testWFlags( WStaticContents ); // setWFlags( WStaticContents ); int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; - do + do { h -= step; XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); @@ -917,9 +917,9 @@ void Client::setShade( ShadeMode mode ) } // tell xcompmgr shade's done _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(); shade_geometry_change = true; @@ -927,7 +927,7 @@ void Client::setShade( ShadeMode mode ) // FRAME bool wasStaticContents = testWFlags( WStaticContents ); // setWFlags( WStaticContents ); int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; - do + do { h += step; XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); @@ -1733,14 +1733,14 @@ void Client::closeWindow() if( !isCloseable()) return; // Update user time, because the window may create a confirming dialog. - updateUserTime(); + updateUserTime(); if ( Pdeletewindow ) { Notify::raise( Notify::Close ); sendClientMessage( window(), atoms->wm_protocols, atoms->wm_delete_window); pingWindow(); } - else + else { // client will not react on wm_delete_window. We have not choice // but destroy his connection to the XServer. @@ -2267,7 +2267,7 @@ bool Client::providesContextHelp() const */ void Client::showContextHelp() { - if ( Pcontexthelp ) + if ( Pcontexthelp ) { sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help); TQWhatsThis::enterWhatsThisMode(); // SELI? @@ -2286,17 +2286,17 @@ void Client::fetchName() TQString Client::readName() const { - if ( info->name() && info->name()[ 0 ] != '\0' ) + if ( info->name() && info->name()[ 0 ] != '\0' ) return TQString::fromUtf8( info->name() ); - else + else return KWin::readNameProperty( window(), XA_WM_NAME ); } - + KWIN_COMPARE_PREDICATE( FetchNameInternalPredicate, const Client*, (!cl->isSpecialWindow() || cl->isToolbar()) && cl != value && cl->caption() == value->caption()); void Client::setCaption( const TQString& s, bool force ) { - if ( s != cap_normal || force ) + if ( s != cap_normal || force ) { bool reset_name = force; for( unsigned int i = 0; @@ -2311,10 +2311,10 @@ void Client::setCaption( const TQString& s, bool force ) machine_suffix = " <@" + wmClientMachine( true ) + ">"; TQString shortcut_suffix = !shortcut().isNull() ? ( " {" + shortcut().toString() + "}" ) : ""; cap_suffix = machine_suffix + shortcut_suffix; - if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this ))) + if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this ))) { int i = 2; - do + do { cap_suffix = machine_suffix + " <" + TQString::number(i) + ">" + shortcut_suffix; i++; @@ -2344,11 +2344,11 @@ void Client::updateCaption() void Client::fetchIconicName() { TQString s; - if ( info->iconName() && info->iconName()[ 0 ] != '\0' ) + if ( info->iconName() && info->iconName()[ 0 ] != '\0' ) s = TQString::fromUtf8( info->iconName() ); - else + else s = KWin::readNameProperty( window(), XA_WM_ICON_NAME ); - if ( s != cap_iconic ) + if ( s != cap_iconic ) { bool was_set = !cap_iconic.isEmpty(); cap_iconic = s; @@ -2409,7 +2409,7 @@ void Client::getMotifHints() } void Client::readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon ) - { + { // get the icons, allow scaling if( icon != NULL ) *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, &nitems, &extra, &data ); XSetErrorHandler(oldHandler); - if (status == Success ) + if (status == Success ) { if (data && nitems > 0) result = *((Window*) data); @@ -2703,7 +2703,7 @@ void Client::setCursor( Position m ) { m = PositionCenter; } - switch ( m ) + switch ( m ) { case PositionTopLeft: case PositionBottomRight: @@ -2977,7 +2977,7 @@ void Client::updateOpacity() } } } - + void Client::updateShadowSize() // 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; } - + bool Client::getWindowOpacity() //query translucency settings from X, returns true if window opacity is set { unsigned char *data = 0; @@ -3016,12 +3016,12 @@ bool Client::getWindowOpacity() //query translucency settings from X, returns tr } return FALSE; } - + void Client::setCustomOpacityFlag(bool custom) { custom_opacity = custom; } - + uint Client::opacity() { return opacity_; @@ -3031,7 +3031,7 @@ int Client::opacityPercentage() { return int(100*((double)opacity_/0xffffffff)); } - + bool Client::touches(const Client* c) // 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 FALSE; } - + void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth) { long data = (topHeight < 255 ? topHeight : 255) << 24 | @@ -3059,7 +3059,7 @@ void Client::unsetDecoHashProperty() { XDeleteProperty( tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash); } - + #ifndef NDEBUG kdbgstream& operator<<( kdbgstream& stream, const Client* cl ) { diff --git a/twin/client.h b/twin/client.h index ae90fb619..302baaa62 100644 --- a/twin/client.h +++ b/twin/client.h @@ -455,7 +455,7 @@ class Client : public TQObject, public KDecorationDefines static void sendClientMessage( Window w, Atom a, Atom protocol, 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 detectShapable(); void destroyDecoration(); @@ -482,11 +482,11 @@ class Client : public TQObject, public KDecorationDefines bool move_faked_activity; Window move_resize_grab_window; bool unrestrictedMoveResize; - bool isMove() const + bool isMove() const { return moveResizeMode && mode == PositionCenter; } - bool isResize() const + bool isResize() const { return moveResizeMode && mode != PositionCenter; } @@ -959,7 +959,7 @@ inline bool Client::hasUserTimeSupport() const { return info->userTime() != -1U; } - + inline bool Client::ignoreFocusStealing() const { return ignore_focus_stealing; diff --git a/twin/events.cpp b/twin/events.cpp index 8430ad93a..d87b29e84 100644 --- a/twin/events.cpp +++ b/twin/events.cpp @@ -194,7 +194,7 @@ void RootInfo::changeShowingDesktop( bool showing ) */ 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; 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 - switch (e->type) + switch (e->type) { case ButtonPress: case ButtonRelease: @@ -284,7 +284,7 @@ bool Workspace::workspaceEvent( XEvent * e ) return true; } - switch (e->type) + switch (e->type) { case CreateNotify: if ( e->xcreatewindow.parent == root && @@ -303,7 +303,7 @@ bool Workspace::workspaceEvent( XEvent * e ) case UnmapNotify: { // 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 // icons automatically get unmapped, reparented and mapped @@ -317,7 +317,7 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( XCheckTypedWindowEvent (tqt_xdisplay(), w, ReparentNotify, &ev) ) { - if ( ev.xreparent.parent != root ) + if ( ev.xreparent.parent != root ) { XReparentWindow( tqt_xdisplay(), w, root, 0, 0 ); addSystemTrayWin( w ); @@ -351,7 +351,7 @@ bool Workspace::workspaceEvent( XEvent * e ) // e->xmaprequest.window is different from e->xany.window // TODO this shouldn't be necessary now 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 // 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 ) ) return TRUE; c = createClient( e->xmaprequest.window, false ); - if ( c != NULL && root != tqt_xrootwin() ) + if ( c != NULL && root != tqt_xrootwin() ) { // TODO what is this? // TODO may use TQWidget::create XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 ); @@ -405,7 +405,7 @@ bool Workspace::workspaceEvent( XEvent * e ) } case ConfigureRequest: { - if ( e->xconfigurerequest.parent == root ) + if ( e->xconfigurerequest.parent == root ) { XWindowChanges wc; 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? - switch (e->type) + switch (e->type) { case UnmapNotify: unmapNotifyEvent( &e->xunmap ); @@ -800,7 +800,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e ) return; } - if ( e->value_mask & CWBorderWidth ) + if ( e->value_mask & CWBorderWidth ) { // first, get rid of a window border XWindowChanges wc; @@ -836,7 +836,7 @@ void Client::propertyNotifyEvent( XPropertyEvent* e ) { if( e->window != window()) return; // ignore frame/wrapper - switch ( e->atom ) + switch ( e->atom ) { case XA_WM_NORMAL_HINTS: getWmNormalHints(); @@ -874,10 +874,10 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) return; // care only about entering the whole frame if( e->mode == NotifyNormal || ( !options->focusPolicyIsReasonable() && - e->mode == NotifyUngrab ) ) + e->mode == NotifyUngrab ) ) { - if (options->shadeHover && isShade()) + if (options->shadeHover && isShade()) { delete shadeHoverTimer; shadeHoverTimer = new TQTimer( this ); @@ -890,7 +890,7 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) if ( options->autoRaise && !isDesktop() && !isDock() && !isTopMenu() && workspace()->focusChangeEnabled() && - workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this ) + workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this ) { delete autoRaiseTimer; autoRaiseTimer = new TQTimer( this ); @@ -919,9 +919,9 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) { if( e->window != frameId()) return; // care only about leaving the whole frame - if ( e->mode == NotifyNormal ) + if ( e->mode == NotifyNormal ) { - if ( !buttonDown ) + if ( !buttonDown ) { mode = PositionCenter; 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 // if this window is another client, but not if it's a popup ... maybe after KDE3.1 :( // (repeat after me 'AARGHL!') - if ( !lostMouse && e->detail != NotifyInferior ) + if ( !lostMouse && e->detail != NotifyInferior ) { int d1, d2, d3, d4; unsigned int d5; @@ -943,7 +943,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) || child == None ) lostMouse = true; // really lost the mouse } - if ( lostMouse ) + if ( lostMouse ) { cancelAutoRaise(); workspace()->cancelDelayFocus(); @@ -963,7 +963,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) #define XScrL KKeyNative::modXScrollLock() void Client::grabButton( int modifier ) { - unsigned int mods[ 8 ] = + unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, @@ -980,7 +980,7 @@ void Client::grabButton( int modifier ) void Client::ungrabButton( int modifier ) { - unsigned int mods[ 8 ] = + unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, @@ -1054,7 +1054,7 @@ int qtToX11Button( TQt::ButtonState button ) return Button3; return AnyButton; } - + int qtToX11State( TQt::ButtonState state ) { int ret = 0; @@ -1368,7 +1368,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in if ( bModKeyHeld ) { was_action = true; - switch (button) + switch (button) { case Button1: com = options->commandAll1(); @@ -1391,7 +1391,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in { was_action = true; perform_handled = true; - switch (button) + switch (button) { case Button1: 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 ) { buttonDown = FALSE; - if ( moveResizeMode ) + if ( moveResizeMode ) { finishMoveResize( false ); // 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()) return true; // care only about the whole frame - if ( !buttonDown ) + if ( !buttonDown ) { Position newmode = mousePosition( TQPoint( x, y )); if( newmode != mode ) @@ -1682,7 +1682,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction ) buttonDown = FALSE; setCursor( mode ); } - else if( direction >= NET::TopLeft && direction <= NET::Left ) + else if( direction >= NET::TopLeft && direction <= NET::Left ) { static const Position convert[] = { @@ -1733,7 +1733,7 @@ void Client::keyPressEvent( uint key_code ) key_code = key_code & 0xffff; int delta = is_control?1:is_alt?32:8; TQPoint pos = TQCursor::pos(); - switch ( key_code ) + switch ( key_code ) { case Key_Left: pos.rx() -= delta; diff --git a/twin/geometry.cpp b/twin/geometry.cpp index fc5f919cf..4bb6714ae 100644 --- a/twin/geometry.cpp +++ b/twin/geometry.cpp @@ -1899,7 +1899,7 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) if( horizontal ) max_mode = MaximizeMode( max_mode ^ MaximizeHorizontal ); } - + max_mode = rules()->checkMaximize( max_mode ); if( !adjust && max_mode == old_mode ) return; @@ -1948,9 +1948,9 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) { max_mode = MaximizeHorizontal; maxmode_restore = MaximizeRestore; - } + } } - + switch (max_mode) { @@ -2476,7 +2476,7 @@ void Client::checkUnrestrictedMoveResize() return; TQRect desktopArea = workspace()->clientArea( WorkArea, moveResizeGeom.center(), desktop()); 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 left_marge = KMIN( 100 + border_right, 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; if( unrestrictedMoveResize ) // unrestricted, just don't let it go out completely 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 left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp index 617ad2fdf..b4f51401c 100644 --- a/twin/kcmtwin/twinoptions/windows.cpp +++ b/twin/kcmtwin/twinoptions/windows.cpp @@ -233,7 +233,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par "in the Notifications control module.
" ); TQWhatsThis::add( focusStealing, wtstr ); TQWhatsThis::add( focusStealingLabel, wtstr ); - + 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.") ); 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())); if (!TQApplication::desktop()->isVirtualDesktop() || - TQApplication::desktop()->numScreens() == 1) // No Ximerama + TQApplication::desktop()->numScreens() == 1) // No Ximerama { separateScreenFocus->hide(); activeMouseScreen->hide(); @@ -498,7 +498,7 @@ void KFocusConfig::load( void ) setClickRaise(key != "off"); setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click setDelayFocusEnabled(); - + setSeparateScreenFocus( config->readBoolEntry(KWIN_SEPARATE_SCREEN_FOCUS, false)); // on by default for non click to focus policies 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); TQVBoxLayout *vLay = new TQVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint()); vLay->addSpacing(11); // to get the proper gb top offset - + onlyDecoTranslucent = new TQCheckBox(i18n("Apply translucency only to decoration"),tGroup); vLay->addWidget(onlyDecoTranslucent); - + vLay->addSpacing(11); - + TQGridLayout *gLay = new TQGridLayout(vLay,4,2,KDialog::spacingHint()); gLay->setColStretch(1,1); diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h index 566f955b5..c7c4c711c 100644 --- a/twin/kcmtwin/twinoptions/windows.h +++ b/twin/kcmtwin/twinoptions/windows.h @@ -276,11 +276,11 @@ class KTranslucencyConfig : public TDECModule public: KTranslucencyConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 ); ~KTranslucencyConfig(); - + void load(); void save(); void defaults(); - + private: TQCheckBox *useTranslucency; TQCheckBox *activeWindowTransparency; diff --git a/twin/layers.cpp b/twin/layers.cpp index 17068a675..adc9bd436 100644 --- a/twin/layers.cpp +++ b/twin/layers.cpp @@ -424,7 +424,7 @@ void Workspace::raiseClientWithinApplication( Client* c ) StackingUpdatesBlocker blocker( this ); // ignore mainwindows - + // first try to put it above the top-most window of the application for( ClientList::Iterator it = unconstrained_stacking_order.fromLast(); it != unconstrained_stacking_order.end(); @@ -596,10 +596,10 @@ ClientList Workspace::constrainedStackingOrder() minimum_layer[ (*it)->group() ] = l; layer[ l ].append( *it ); } - ClientList stacking; + ClientList stacking; for( Layer lay = FirstLayer; lay < NumLayers; - ++lay ) + ++lay ) stacking += layer[ lay ]; #if 0 kdDebug() << "stacking2:" << endl; @@ -757,7 +757,7 @@ void Client::restackWindow( Window /*above TODO */, int detail, NET::RequestSour if( send_event ) sendSyntheticConfigureNotify(); } - + void Client::setKeepAbove( bool b ) { b = rules()->checkKeepAbove( b ); diff --git a/twin/utils.h b/twin/utils.h index e2e6e2a31..f1c1e772e 100644 --- a/twin/utils.h +++ b/twin/utils.h @@ -110,16 +110,19 @@ enum ShadeMode enum ActiveBorder { - ActiveTop, - ActiveTopRight, - ActiveRight, - ActiveBottomRight, - ActiveBottom, - ActiveBottomLeft, - ActiveLeft, - ActiveTopLeft, - ACTIVE_BORDER_COUNT, - ActiveNone + ActiveNone = 0, + + ActiveLeft = 1, + ActiveRight = 2, + ActiveTop = 4, + ActiveBottom = 8, + + ActiveTopLeft = ActiveTop | ActiveLeft, + ActiveTopRight = ActiveTop | ActiveRight, + ActiveBottomLeft = ActiveBottom | ActiveLeft, + ActiveBottomRight = ActiveBottom | ActiveRight, + + ACTIVE_BORDER_COUNT }; enum ActiveMaximizingMode @@ -129,7 +132,7 @@ enum ActiveMaximizingMode ActiveMaximizeMode }; -class Shape +class Shape { public: static bool available() { return twin_shape_version > 0; } @@ -147,12 +150,12 @@ class Shape const int ShapeInput = 2; #endif -class Motif +class Motif { public: static void readFlags( WId w, bool& noborder, bool& resize, bool& move, bool& minimize, bool& maximize, bool& close ); - struct MwmHints + struct MwmHints { ulong flags; ulong functions; @@ -248,7 +251,7 @@ KWIN_CHECK_PREDICATE( TruePredicate, cl == cl /*true, avoid warning about 'cl' * template< typename T > 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))) return *it; diff --git a/twin/workspace.cpp b/twin/workspace.cpp index 950ebf92c..6f6bedb3e 100644 --- a/twin/workspace.cpp +++ b/twin/workspace.cpp @@ -201,8 +201,8 @@ Workspace::Workspace( bool restore ) updateXTime(); // needed for proper initialization of user_time in Client ctor - delayFocusTimer = 0; - + delayFocusTimer = 0; + active_time_first = GET_QT_X_TIME(); active_time_last = GET_QT_X_TIME(); @@ -315,7 +315,7 @@ void Workspace::init() // not used yet // topDock = 0L; // maximizedWindowCounter = 0; - + supportWindow = new TQWidget; XLowerWindow( tqt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp @@ -461,7 +461,7 @@ void Workspace::init() unsigned int i, nwins; Window root_return, parent_return, *wins; XQueryTree(tqt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins); - for (i = 0; i < nwins; i++) + for (i = 0; i < nwins; i++) { XWindowAttributes attr; XGetWindowAttributes(tqt_xdisplay(), wins[i], &attr); @@ -469,12 +469,12 @@ void Workspace::init() continue; if( topmenu_space && topmenu_space->winId() == wins[ i ] ) continue; - if (attr.map_state != IsUnmapped) + if (attr.map_state != IsUnmapped) { if ( addSystemTrayWin( wins[i] ) ) continue; Client* c = createClient( wins[i], true ); - if ( c != NULL && root != tqt_xrootwin() ) + if ( c != NULL && root != tqt_xrootwin() ) { // TODO what is this? // TODO may use TQWidget:.create 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) { Client *client; - + if ((client = findClient(WindowMatchPredicate((WId)window)))) // Redraw overlapping shadows without waiting for the specified window // to redraw its own shadow @@ -820,7 +820,7 @@ void Workspace::updateOverlappingShadows(unsigned long window) void Workspace::setShadowed(unsigned long window, bool shadowed) { Client *client; - + if ((client = findClient(WindowMatchPredicate((WId)window)))) client->setShadowed(shadowed); } @@ -916,7 +916,7 @@ void Workspace::updateCurrentTopMenu() } // ... 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 ) (*it)->hideClient( true ); @@ -1033,7 +1033,7 @@ void Workspace::updateColormap() Colormap cmap = default_colormap; if ( activeClient() && activeClient()->colormap() != None ) cmap = activeClient()->colormap(); - if ( cmap != installed_colormap ) + if ( cmap != installed_colormap ) { XInstallColormap(tqt_xdisplay(), cmap ); installed_colormap = cmap; @@ -1228,7 +1228,7 @@ void Workspace::loadDesktopSettings() desktop_focus_chain.resize( n ); // make it +1, so that it can be accessed as [1..numberofdesktops] 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), i18n("Desktop %1").arg(i)); @@ -1248,21 +1248,21 @@ void Workspace::saveDesktopSettings() TDEConfigGroupSaver saver(c,groupname); 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 defaultvalue = i18n("Desktop %1").arg(i); - if ( s.isEmpty() ) + if ( s.isEmpty() ) { s = defaultvalue; rootInfo->setDesktopName( i, s.utf8().data() ); } - if (s != defaultvalue) + if (s != defaultvalue) { c->writeEntry( TQString("Name_%1").arg(i), s ); } - else + else { TQString currentvalue = c->readEntry(TQString("Name_%1").arg(i)); if (currentvalue != defaultvalue) @@ -1300,10 +1300,10 @@ void Workspace::doNotManage( 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) ); - if (r.search(title) != -1) + if (r.search(title) != -1) { doNotManageList.remove( it ); return TRUE; @@ -1315,7 +1315,7 @@ bool Workspace::isNotManaged( const TQString& title ) /*! Refreshes all the client windows */ -void Workspace::refresh() +void Workspace::refresh() { TQWidget w; w.setGeometry( TQApplication::desktop()->geometry() ); @@ -1352,7 +1352,7 @@ void ObscuringWindows::create( Client* c ) Window obs_win; XWindowChanges chngs; int mask = CWSibling | CWStackMode; - if( cached->count() > 0 ) + if( cached->count() > 0 ) { cached->remove( obs_win = cached->first()); chngs.x = c->x(); @@ -1361,7 +1361,7 @@ void ObscuringWindows::create( Client* c ) chngs.height = c->height(); mask |= CWX | CWY | CWWidth | CWHeight; } - else + else { XSetWindowAttributes a; a.background_pixmap = None; @@ -1382,7 +1382,7 @@ ObscuringWindows::~ObscuringWindows() max_cache_size = TQMAX( max_cache_size, obscuring_windows.count() + 4 ) - 1; for( TQValueList