diff options
Diffstat (limited to 'twin/workspace.cpp')
-rw-r--r-- | twin/workspace.cpp | 277 |
1 files changed, 154 insertions, 123 deletions
diff --git a/twin/workspace.cpp b/twin/workspace.cpp index 5f75edd90..2d95e9226 100644 --- a/twin/workspace.cpp +++ b/twin/workspace.cpp @@ -23,8 +23,8 @@ License. See the file "COPYING" for the exact licensing terms. #include <tqbitmap.h> #include <tqclipboard.h> #include <tdemenubar.h> -#include <kprocess.h> -#include <kglobalaccel.h> +#include <tdeprocess.h> +#include <tdeglobalaccel.h> #include <dcopclient.h> #include <kipc.h> @@ -58,7 +58,7 @@ Workspace *Workspace::_self = 0; TDEProcess* kompmgr = 0; TDESelectionOwner* kompmgr_selection; -bool allowKompmgrRestart = TRUE; +bool allowKompmgrRestart = true; extern bool disable_twin_composition_manager; bool supportsCompMgr() @@ -187,7 +187,7 @@ Workspace::Workspace( bool restore ) root = tqt_xrootwin(); default_colormap = DefaultColormap(tqt_xdisplay(), tqt_xscreen() ); installed_colormap = default_colormap; - session.setAutoDelete( TRUE ); + session.setAutoDelete( true ); for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) { @@ -195,9 +195,9 @@ Workspace::Workspace( bool restore ) active_windows[i] = None; } - connect( &temporaryRulesMessages, TQT_SIGNAL( gotMessage( const TQString& )), - this, TQT_SLOT( gotTemporaryRulesMessage( const TQString& ))); - connect( &rulesUpdatedTimer, TQT_SIGNAL( timeout()), this, TQT_SLOT( writeWindowRules())); + connect( &temporaryRulesMessages, TQ_SIGNAL( gotMessage( const TQString& )), + this, TQ_SLOT( gotTemporaryRulesMessage( const TQString& ))); + connect( &rulesUpdatedTimer, TQ_SIGNAL( timeout()), this, TQ_SLOT( writeWindowRules())); updateXTime(); // needed for proper initialization of user_time in Client ctor @@ -220,7 +220,7 @@ Workspace::Workspace( bool restore ) (WFlags)(TQt::WType_Desktop | TQt::WPaintUnclipped) ); - kapp->setGlobalMouseTracking( true ); // so that this doesn't mess eventmask on root window later + tdeApp->setGlobalMouseTracking( true ); // so that this doesn't mess eventmask on root window later // call this before XSelectInput() on the root window startup = new TDEStartupInfo( TDEStartupInfo::DisableKWinModule | TDEStartupInfo::AnnounceSilenceChanges, this ); @@ -259,7 +259,7 @@ Workspace::Workspace( bool restore ) init(); #if (TQT_VERSION-0 >= 0x030200) // XRANDR support - connect( kapp->desktop(), TQT_SIGNAL( resized( int )), TQT_SLOT( desktopResized())); + connect( tdeApp->desktop(), TQ_SIGNAL( resized( int )), TQ_SLOT( desktopResized())); #endif if (!supportsCompMgr()) { @@ -274,7 +274,7 @@ Workspace::Workspace( bool restore ) if (options->useTranslucency) { kompmgr = new TDEProcess; - connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + connect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); *kompmgr << TDE_COMPOSITOR_BINARY; if (kompmgrpid) { @@ -414,12 +414,12 @@ void Workspace::init() // extra NETRootInfo instance in Client mode is needed to get the values of the properties NETRootInfo client_info( tqt_xdisplay(), NET::ActiveWindow | NET::CurrentDesktop ); int initial_desktop; - if( !kapp->isSessionRestored()) + if( !tdeApp->isSessionRestored()) initial_desktop = client_info.currentDesktop(); else { - TDEConfigGroupSaver saver( kapp->sessionConfig(), "Session" ); - initial_desktop = kapp->sessionConfig()->readNumEntry( "desktop", 1 ); + TDEConfigGroupSaver saver( tdeApp->sessionConfig(), "Session" ); + initial_desktop = tdeApp->sessionConfig()->readNumEntry( "desktop", 1 ); } if( !setCurrentDesktop( initial_desktop )) setCurrentDesktop( 1 ); @@ -427,20 +427,20 @@ void Workspace::init() // now we know how many desktops we'll, thus, we initialise the positioning object initPositioning = new Placement(this); - connect(&reconfigureTimer, TQT_SIGNAL(timeout()), this, - TQT_SLOT(slotReconfigure())); - connect( &updateToolWindowsTimer, TQT_SIGNAL( timeout()), this, TQT_SLOT( slotUpdateToolWindows())); + connect(&reconfigureTimer, TQ_SIGNAL(timeout()), this, + TQ_SLOT(slotReconfigure())); + connect( &updateToolWindowsTimer, TQ_SIGNAL( timeout()), this, TQ_SLOT( slotUpdateToolWindows())); - connect(kapp, TQT_SIGNAL(appearanceChanged()), this, - TQT_SLOT(slotReconfigure())); - connect(kapp, TQT_SIGNAL(settingsChanged(int)), this, - TQT_SLOT(slotSettingsChanged(int))); - connect(kapp, TQT_SIGNAL( kipcMessage( int, int )), this, TQT_SLOT( kipcMessage( int, int ))); + connect(tdeApp, TQ_SIGNAL(appearanceChanged()), this, + TQ_SLOT(slotReconfigure())); + connect(tdeApp, TQ_SIGNAL(settingsChanged(int)), this, + TQ_SLOT(slotSettingsChanged(int))); + connect(tdeApp, TQ_SIGNAL( kipcMessage( int, int )), this, TQ_SLOT( kipcMessage( int, int ))); active_client = NULL; rootInfo->setActiveWindow( None ); focusToNull(); - if( !kapp->isSessionRestored()) + if( !tdeApp->isSessionRestored()) ++block_focus; // because it will be set below char nm[ 100 ]; @@ -503,7 +503,7 @@ void Workspace::init() } // end updates blocker block Client* new_active_client = NULL; - if( !kapp->isSessionRestored()) + if( !tdeApp->isSessionRestored()) { --block_focus; new_active_client = findClient( WindowMatchPredicate( client_info.activeWindow())); @@ -1188,10 +1188,10 @@ void Workspace::slotReconfigure() if (!kompmgr) { kompmgr = new TDEProcess; - connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + connect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); *kompmgr << TDE_COMPOSITOR_BINARY; } - TQTimer::singleShot( 200, this, TQT_SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart + TQTimer::singleShot( 200, this, TQ_SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart } } else @@ -1277,7 +1277,7 @@ TQStringList Workspace::configModules(bool controlCenter) args << "tde-twindecoration.desktop"; if (controlCenter) args << "tde-twinoptions.desktop"; - else if (kapp->authorizeControlModule("tde-twinoptions.desktop")) + else if (tdeApp->authorizeControlModule("tde-twinoptions.desktop")) args << "twinactions" << "twinfocus" << "twinmoving" << "twinadvanced" << "twinrules" << "twintranslucency"; return args; } @@ -1306,10 +1306,10 @@ bool Workspace::isNotManaged( const TQString& title ) if (r.search(title) != -1) { doNotManageList.remove( it ); - return TRUE; + return true; } } - return FALSE; + return false; } /*! @@ -1423,7 +1423,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) current_desktop = new_desktop; // change the desktop (so that Client::updateVisibility() works) - bool desktopHasCompositing = kapp->isCompositionManagerAvailable(); // Technically I should call isX11CompositionAvailable(), but it isn't initialized via my kapp constructir, and in this case it doesn't really matter anyway.... + bool desktopHasCompositing = tdeApp->isCompositionManagerAvailable(); // Technically I should call isX11CompositionAvailable(), but it isn't initialized via my tdeApp constructir, and in this case it doesn't really matter anyway.... if (!desktopHasCompositing) { // If composition is not in use then we can hide the old windows before showing the new ones for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) { @@ -1806,7 +1806,7 @@ void Workspace::setActiveScreenMouse( TQPoint mousepos ) TQRect Workspace::screenGeometry( int screen ) const { - if (( !options->xineramaEnabled ) || (kapp->desktop()->numScreens() < 2)) + if (( !options->xineramaEnabled ) || (tdeApp->desktop()->numScreens() < 2)) return tqApp->desktop()->geometry(); return tqApp->desktop()->screenGeometry( screen ); } @@ -1875,19 +1875,19 @@ void Workspace::calcDesktopLayout(int &x, int &y) const bool Workspace::addSystemTrayWin( WId w ) { if ( systemTrayWins.contains( w ) ) - return TRUE; + return true; NETWinInfo ni( tqt_xdisplay(), w, root, NET::WMKDESystemTrayWinFor ); WId trayWinFor = ni.kdeSystemTrayWinFor(); if ( !trayWinFor ) - return FALSE; + return false; systemTrayWins.append( SystemTrayWindow( w, trayWinFor ) ); XSelectInput( tqt_xdisplay(), w, StructureNotifyMask ); XAddToSaveSet( tqt_xdisplay(), w ); propagateSystemTrayWins(); - return TRUE; + return true; } /*! @@ -1897,7 +1897,7 @@ bool Workspace::addSystemTrayWin( WId w ) bool Workspace::removeSystemTrayWin( WId w, bool check ) { if ( !systemTrayWins.contains( w ) ) - return FALSE; + return false; if( check ) { // When getting UnmapNotify, it's not clear if it's the systray @@ -1925,7 +1925,7 @@ bool Workspace::removeSystemTrayWin( WId w, bool check ) systemTrayWins.remove( w ); XRemoveFromSaveSet (tqt_xdisplay (), w); propagateSystemTrayWins(); - return TRUE; + return true; } @@ -2155,16 +2155,16 @@ void Workspace::slotMouseEmulation() if ( mouse_emulation ) { XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); - mouse_emulation = FALSE; + mouse_emulation = false; return; } if ( XGrabKeyboard(tqt_xdisplay(), - root, FALSE, + root, false, GrabModeAsync, GrabModeAsync, get_tqt_x_time()) == GrabSuccess ) { - mouse_emulation = TRUE; + mouse_emulation = true; mouse_emulation_state = 0; mouse_emulation_window = 0; } @@ -2284,7 +2284,7 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) { if ( root != tqt_xrootwin() ) - return FALSE; + return false; int kc = XkbKeycodeToKeysym(tqt_xdisplay(), ev.keycode, 0, 0); int km = ev.state & (ControlMask | Mod1Mask | ShiftMask); @@ -2361,16 +2361,16 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) // fall through case XK_Escape: XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); - mouse_emulation = FALSE; - return TRUE; + mouse_emulation = false; + return true; default: - return FALSE; + return false; } TQCursor::setPos( pos ); if ( mouse_emulation_state ) mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuMove, 0, mouse_emulation_state ); - return TRUE; + return true; } @@ -2396,8 +2396,8 @@ void Workspace::requestDelayFocus( Client* c ) delayfocus_client = c; delete delayFocusTimer; delayFocusTimer = new TQTimer( this ); - connect( delayFocusTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( delayFocus() ) ); - delayFocusTimer->start( options->delayFocusInterval, TRUE ); + connect( delayFocusTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( delayFocus() ) ); + delayFocusTimer->start( options->delayFocusInterval, true ); } void Workspace::cancelDelayFocus() @@ -2506,7 +2506,7 @@ void Workspace::reserveActiveBorder( ActiveBorder border ) return; if (active_reserved[border]++ == 0) - TQTimer::singleShot(0, this, TQT_SLOT(updateActiveBorders())); + TQTimer::singleShot(0, this, TQ_SLOT(updateActiveBorders())); } void Workspace::unreserveActiveBorder( ActiveBorder border ) @@ -2516,7 +2516,7 @@ void Workspace::unreserveActiveBorder( ActiveBorder border ) assert(active_reserved[ border ] > 0); if (--active_reserved[ border ] == 0) - TQTimer::singleShot(0, this, TQT_SLOT(updateActiveBorders())); + TQTimer::singleShot(0, this, TQ_SLOT(updateActiveBorders())); } void Workspace::checkActiveBorder(const TQPoint &pos, Time now) @@ -2542,15 +2542,21 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) int distance_reset = activation_distance + 10; // Leave active maximizing mode when window moved away - if (active_current_border != ActiveNone && - (pos.x() > activeLeft + distance_reset) && - (pos.x() < activeRight - distance_reset) && - (pos.y() > activeTop + distance_reset) && - (pos.y() < activeBottom - distance_reset)) - { - if (movingClient && - (options->activeBorders() == Options::ActiveTileMaximize || - options->activeBorders() == Options::ActiveTileOnly)) + if (movingClient && + (options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly)) + { + TQRect r = TQApplication::desktop()->screenGeometry(pos); + activeTop = r.top(); + activeBottom = r.bottom(); + activeLeft = r.left(); + activeRight = r.right(); + + if (active_current_border != ActiveNone && + (pos.x() > activeLeft + distance_reset) && + (pos.x() < activeRight - distance_reset) && + (pos.y() > activeTop + distance_reset) && + (pos.y() < activeBottom - distance_reset)) { movingClient->cancelActiveBorderMaximizing(); return; @@ -2559,53 +2565,77 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) // These checks take activation distance into account, creating a // virtual "activation band" for easier border/corner activation. - bool active_left = pos.x() < activeLeft + activation_distance, - active_right = pos.x() > activeRight - activation_distance, - active_top = pos.y() < activeTop + activation_distance, - active_bottom = pos.y() > activeBottom - activation_distance; + bool active_left = pos.x() < activeLeft + activation_distance; + bool active_right = pos.x() > activeRight - activation_distance; + bool active_top = pos.y() < activeTop + activation_distance; + bool active_bottom = pos.y() > activeBottom - activation_distance; + + if (!active_left && !active_right && !active_top && !active_bottom) + return; // These checks are used to make corner activation easier: we assume // a 25% zone on the edge of each border where instead of half size // tiling we perform quarter size tiling. The rest 50% is left for // normal half size tiling. - uint active_width_quart = activeRight / 4, - active_height_quart = activeBottom / 4; + // These options make sense only for the tiling mode. + int active_width_quart = (activeRight - activeLeft) / 4; + int active_height_quart = (activeBottom - activeTop) / 4; - bool active_qleft = pos.x() < activeLeft + active_width_quart, - active_qright = pos.x() > activeRight - active_width_quart, - active_qtop = pos.y() < activeTop + active_height_quart, - active_qbottom = pos.y() > activeBottom - active_height_quart; - - int border = ActiveNone; - - if (active_left) border |= ActiveLeft; - if (active_right) border |= ActiveRight; - if (active_top) border |= ActiveTop; - if (active_bottom) border |= ActiveBottom; - - if (border == ActiveLeft || border == ActiveRight) { - if (active_qtop) border |= ActiveTop; - if (active_qbottom) border |= ActiveBottom; + bool active_qleft = false; + bool active_qright = false; + bool active_qtop = false; + bool active_qbottom = false; + if (options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly) + { + active_qleft = pos.x() < activeLeft + active_width_quart; + active_qright = pos.x() > activeRight - active_width_quart; + active_qtop = pos.y() < activeTop + active_height_quart; + active_qbottom = pos.y() > activeBottom - active_height_quart; } - else if (border == ActiveTop || border == ActiveBottom) { - if (active_qleft) border |= ActiveLeft; - if (active_qright) border |= ActiveRight; + ActiveBorder border = ActiveNone; + if ((active_left && active_qtop) || (active_top && active_qleft)) + { + border = ActiveTopLeft; } - - bool border_valid = false; - for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) { - if (border == (ActiveBorder)i) { - border_valid = true; - } + else if ((active_right && active_qtop) || (active_top && active_qright)) + { + border = ActiveTopRight; } - - if (!border_valid) { - abort(); + else if ((active_left && active_qbottom) || (active_bottom && active_qleft)) + { + border = ActiveBottomLeft; + } + else if ((active_right && active_qbottom) || (active_bottom && active_qright)) + { + border = ActiveBottomRight; + } + else if (active_left) + { + border = ActiveLeft; + } + else if (active_right) + { + border = ActiveRight; + } + else if (active_top) + { + border = ActiveTop; + } + else if (active_bottom) + { + border = ActiveBottom; + } + else + { + // Should never happen + abort(); } - if (border == ActiveNone || active_windows[border] == None) { - return; + if( active_windows[border] == None ) + { + return; } if ((active_current_border == border) && @@ -2627,7 +2657,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) if (options->activeBorders() == Options::ActiveSwitchAlways || options->activeBorders() == Options::ActiveSwitchOnMove) { - activeBorderSwitchDesktop((ActiveBorder)border, pos); + activeBorderSwitchDesktop(border, pos); return; // Don't reset cursor position } @@ -2637,6 +2667,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) { if (!movingClient->isResizable()) return; movingClient->setActiveBorderMode(ActiveMaximizeMode); + movingClient->setActiveBorderPos(pos); movingClient->setActiveBorder(ActiveNone); movingClient->setActiveBorderMaximizing(true); } @@ -2647,7 +2678,8 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) { if (!movingClient->isResizable()) return; movingClient->setActiveBorderMode(ActiveTilingMode); - movingClient->setActiveBorder((ActiveBorder)border); + movingClient->setActiveBorderPos(pos); + movingClient->setActiveBorder(border); movingClient->setActiveBorderMaximizing(true); } @@ -2661,7 +2693,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) // Desktop switching if (options->activeBorders() == Options::ActiveSwitchAlways && isSide) { - activeBorderSwitchDesktop((ActiveBorder)border, pos); + activeBorderSwitchDesktop(border, pos); return; // Don't reset cursor position } } @@ -2669,7 +2701,7 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) } else { - active_current_border = (ActiveBorder)border; + active_current_border = border; active_time_first = now; active_time_last = now; active_push_point = pos; @@ -2680,9 +2712,9 @@ void Workspace::checkActiveBorder(const TQPoint &pos, Time now) { // Reset the pointer to find out whether the user is really pushing // (ordered according to enum ActiveBorder minus ActiveNone) - const int xdiff[ACTIVE_BORDER_COUNT] = {1, -1, 0, 0, 1, -1, 1, -1}; - const int ydiff[ACTIVE_BORDER_COUNT] = {0, 0, 1, -1, 1, 1, -1, -1}; - TQCursor::setPos(pos.x() + xdiff[border - 1], pos.y() + ydiff[border - 1]); + const int xdiff[ ACTIVE_BORDER_COUNT ] = { 0, -1, -1, -1, 0, 1, 1, 1 }; + const int ydiff[ ACTIVE_BORDER_COUNT ] = { 1, 1, 0, -1, -1, -1, 0, 1 }; + TQCursor::setPos(pos.x() + xdiff[border], pos.y() + ydiff[border]); } } @@ -2788,12 +2820,12 @@ void Workspace::lostTopMenuSelection() { // kdDebug() << "lost TopMenu selection" << endl; // make sure this signal is always set when not owning the selection - disconnect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); - connect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); + disconnect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); + connect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); if( !managing_topmenus ) return; - connect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); - disconnect( topmenu_selection, TQT_SIGNAL( lostOwnership()), this, TQT_SLOT( lostTopMenuSelection())); + connect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); + disconnect( topmenu_selection, TQ_SIGNAL( lostOwnership()), this, TQ_SLOT( lostTopMenuSelection())); managing_topmenus = false; delete topmenu_space; topmenu_space = NULL; @@ -2822,8 +2854,8 @@ void Workspace::setupTopMenuHandling() { if( managing_topmenus ) return; - connect( topmenu_selection, TQT_SIGNAL( lostOwnership()), this, TQT_SLOT( lostTopMenuSelection())); - disconnect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); + connect( topmenu_selection, TQ_SIGNAL( lostOwnership()), this, TQ_SLOT( lostTopMenuSelection())); + disconnect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); managing_topmenus = true; topmenu_space = new TQWidget; Window stack[ 2 ]; @@ -2934,7 +2966,7 @@ void Workspace::startKompmgr() } else { // Try again a bit later! - TQTimer::singleShot( 200, this, TQT_SLOT(startKompmgr()) ); + TQTimer::singleShot( 200, this, TQ_SLOT(startKompmgr()) ); return; } pid_t kompmgrpid = getCompositorPID(); @@ -2949,7 +2981,7 @@ void Workspace::startKompmgr() } if (!kompmgr->start(TDEProcess::OwnGroup, TDEProcess::Stderr)) { - options->useTranslucency = FALSE; + options->useTranslucency = false; TDEProcess proc; proc << "kdialog" << "--error" << i18n("The Composite Manager could not be started.\\nMake sure you have \"" TDE_COMPOSITOR_BINARY "\" in a $PATH directory.") @@ -2962,16 +2994,16 @@ void Workspace::startKompmgr() char selection_name[ 100 ]; sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( tqt_xdisplay())); kompmgr_selection = new TDESelectionOwner( selection_name ); - connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr())); + connect( kompmgr_selection, TQ_SIGNAL( lostOwnership()), TQ_SLOT( stopKompmgr())); kompmgr_selection->claim( true ); - connect(kompmgr, TQT_SIGNAL(processExited(TDEProcess*)), TQT_SLOT(restartKompmgr(TDEProcess*))); - options->useTranslucency = TRUE; - //allowKompmgrRestart = FALSE; - //TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); + connect(kompmgr, TQ_SIGNAL(processExited(TDEProcess*)), TQ_SLOT(restartKompmgr(TDEProcess*))); + options->useTranslucency = true; + //allowKompmgrRestart = false; + //TQTimer::singleShot( 60000, this, TQ_SLOT(unblockKompmgrRestart()) ); TQByteArray ba; TQDataStream arg(ba, IO_WriteOnly); arg << ""; - kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStarted()", ba); + tdeApp->dcopClient()->emitDCOPSignal("default", "kompmgrStarted()", ba); } if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider } @@ -2983,14 +3015,14 @@ void Workspace::stopKompmgr() } delete kompmgr_selection; kompmgr_selection = NULL; - kompmgr->disconnect(this, TQT_SLOT(restartKompmgr(TDEProcess*))); - options->useTranslucency = FALSE; + kompmgr->disconnect(this, TQ_SLOT(restartKompmgr(TDEProcess*))); + options->useTranslucency = false; if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider kompmgr->kill(SIGKILL); TQByteArray ba; TQDataStream arg(ba, IO_WriteOnly); arg << ""; - kapp->dcopClient()->emitDCOPSignal("default", "kompmgrStopped()", ba); + tdeApp->dcopClient()->emitDCOPSignal("default", "kompmgrStopped()", ba); } void Workspace::kompmgrReloadSettings() @@ -3008,11 +3040,11 @@ bool Workspace::kompmgrIsRunning() void Workspace::unblockKompmgrRestart() { - allowKompmgrRestart = TRUE; + allowKompmgrRestart = true; } void Workspace::restartKompmgr( TDEProcess *proc ) -// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQT_SLOT(startKompmgr())); +// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQ_SLOT(startKompmgr())); { bool crashed; if (proc->signalled()) { // looks like kompmgr may have crashed @@ -3027,7 +3059,7 @@ void Workspace::restartKompmgr( TDEProcess *proc ) { delete kompmgr_selection; kompmgr_selection = NULL; - options->useTranslucency = FALSE; + options->useTranslucency = false; if (crashed) { TDEProcess proc; proc << "kdialog" << "--error" @@ -3051,7 +3083,7 @@ void Workspace::restartKompmgr( TDEProcess *proc ) { delete kompmgr_selection; kompmgr_selection = NULL; - options->useTranslucency = FALSE; + options->useTranslucency = false; TDEProcess proc; proc << "kdialog" << "--error" << i18n("The Composite Manager could not be started.\\nMake sure you have \"" TDE_COMPOSITOR_BINARY "\" in a $PATH directory.") @@ -3060,8 +3092,8 @@ void Workspace::restartKompmgr( TDEProcess *proc ) } else { - allowKompmgrRestart = FALSE; - TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); + allowKompmgrRestart = false; + TQTimer::singleShot( 60000, this, TQ_SLOT(unblockKompmgrRestart()) ); } } } @@ -3088,7 +3120,7 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen) else return; //skip others // kompmgr startup failed or succeeded, release connection kompmgr->closeStderr(); - disconnect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), this, TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + disconnect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), this, TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); if( !message.isEmpty()) { TDEProcess proc; @@ -3099,7 +3131,6 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen) } } - void Workspace::setOpacity(unsigned long winId, unsigned int opacityPercent) { if (opacityPercent > 100) opacityPercent = 100; |