void KDecoration::toggleOnAllDesktops() { if(isOnAllDesktops()) setDesktop(bridge_->currentDesktop()); else setDesktop(NET::OnAllDesktops); }
void AbstractClient::setOnAllDesktops(bool b) { if ((b && isOnAllDesktops()) || (!b && !isOnAllDesktops())) return; if (b) setDesktop(NET::OnAllDesktops); else setDesktop(VirtualDesktopManager::self()->current()); }
void DesktopTracker::setBase(SPDesktop *desktop) { if (this->base != desktop) { base = desktop; // Do not override an existing target desktop if (!this->desktop) { setDesktop(desktop); } } }
void DesktopTracker::handleHierarchyChange() { GtkWidget *wdgt = gtk_widget_get_ancestor(widget, SP_TYPE_DESKTOP_WIDGET); bool newFlag = (wdgt == 0); // true means not in an SPDesktopWidget, thus floating. if (wdgt && !base) { SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(wdgt); if (dtw && dtw->desktop) { setBase(dtw->desktop); // may also set desktop } } if (newFlag != trackActive) { trackActive = newFlag; if (trackActive) { setDesktop(SP_ACTIVE_DESKTOP); } else if (desktop != base) { setDesktop(getBase()); } } }
void KomposeFullscreenWidget::initView() { setCursor( KCursor::waitCursor() ); destroyChildWidgets(); if ( type == KomposeSettings::EnumView::VirtualDesktops ) { disconnect( KomposeTaskManager::self(), SIGNAL( newTask( KomposeTask* ) ), this, SLOT( createTaskWidget( KomposeTask* ) ) ); layout->setType( TLAYOUT_TASKCONTAINERS ); setDesktop( -2 ); createDesktopWidgets(); }
void menu(struct menuInfo* theSelectedInfo, int *theConfHasBeenUpdated) { ENTER("menu"); enum MENU_State aMenuState=MENU_Volume; struct menuInfo aOldInfo; if (!theSelectedInfo || !theConfHasBeenUpdated) { return; } memcpy( &aOldInfo, theSelectedInfo, sizeof(struct menuInfo)); if (mustSetPreferences()) { *theConfHasBeenUpdated=1; } else { setTextToSpeech( &(theSelectedInfo->myTextToSpeech), theSelectedInfo->myMenuLanguage, theSelectedInfo->myDesktop, 0); aMenuState=MENU_End; *theConfHasBeenUpdated=0; } serialPortInit(); while(aMenuState != MENU_End) { switch(aMenuState) { case MENU_Volume: setVolume(); aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_QuitExpected : MENU_Language; break; case MENU_Language: if (setMenuLanguage( &theSelectedInfo->myMenuLanguage)) { theSelectedInfo->myUserConfIsKnown=1; if (!aOldInfo.myUserConfIsKnown) { /* The default keyboard must match the selected language */ theSelectedInfo->myKeyboard = getProbableKeyboard(theSelectedInfo->myMenuLanguage); loadkeys( theSelectedInfo->myKeyboard); } buildI18n( theSelectedInfo->myMenuLanguage, theSelectedInfo->myTextToSpeech, theSelectedInfo->myKeyboard, theSelectedInfo->myKeyboardFeatures, theSelectedInfo->myDesktop, theSelectedInfo->myUserConfIsKnown); } aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Volume : MENU_Keyboard; break; case MENU_Keyboard: { if(setKeyboard(&theSelectedInfo->myKeyboard, theSelectedInfo->myMenuLanguage)) { theSelectedInfo->myUserConfIsKnown=1; // The keyboard is available as soon as it is selected. loadkeys( theSelectedInfo->myKeyboard); buildI18n( theSelectedInfo->myMenuLanguage, theSelectedInfo->myTextToSpeech, theSelectedInfo->myKeyboard, theSelectedInfo->myKeyboardFeatures, theSelectedInfo->myDesktop, theSelectedInfo->myUserConfIsKnown); } aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Language : MENU_KeyboardFeatures; } break; case MENU_KeyboardFeatures: if (setKeyboardFeatures(& theSelectedInfo->myKeyboardFeatures)) { theSelectedInfo->myUserConfIsKnown=1; buildI18n( theSelectedInfo->myMenuLanguage, theSelectedInfo->myTextToSpeech, theSelectedInfo->myKeyboard, theSelectedInfo->myKeyboardFeatures, theSelectedInfo->myDesktop, theSelectedInfo->myUserConfIsKnown); } aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Keyboard : MENU_Braille; break; case MENU_Braille: { // The braille driver is installed as soon as it is selected. struct brailleInfo aBrailleInfo; getDefaultConf( theSelectedInfo->myKeyboard, & aBrailleInfo ); setBraille( &aBrailleInfo); aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_KeyboardFeatures : MENU_Desktop; } break; case MENU_Desktop: if (setDesktop( &(theSelectedInfo->myDesktop))) { theSelectedInfo->myUserConfIsKnown=1; buildI18n( theSelectedInfo->myMenuLanguage, theSelectedInfo->myTextToSpeech, theSelectedInfo->myKeyboard, theSelectedInfo->myKeyboardFeatures, theSelectedInfo->myDesktop, theSelectedInfo->myUserConfIsKnown); } aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Braille : MENU_TTS; break; case MENU_TTS: if (setTextToSpeech( &(theSelectedInfo->myTextToSpeech), theSelectedInfo->myMenuLanguage, theSelectedInfo->myDesktop, 1)) { theSelectedInfo->myUserConfIsKnown=1; buildI18n( theSelectedInfo->myMenuLanguage, theSelectedInfo->myTextToSpeech, theSelectedInfo->myKeyboard, theSelectedInfo->myKeyboardFeatures, theSelectedInfo->myDesktop, theSelectedInfo->myUserConfIsKnown); } aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Desktop : MENU_Internet; break; case MENU_Internet: { setInternet( theSelectedInfo); aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_TTS : MENU_PersistentStorage; } break; case MENU_PersistentStorage: { setPersistentStorage( theSelectedInfo); aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_Internet : MENU_QuitExpected; } break; case MENU_QuitExpected: { if (setQuitExpected()) { aMenuState = MENU_End; } else { aMenuState = (GNC_UpArrowKey == getLastKeyPressed()) ? MENU_PersistentStorage : MENU_Volume; } } break; default: aMenuState = MENU_End; // Security break; } } clearStoredSentences(); if (!*theConfHasBeenUpdated) { *theConfHasBeenUpdated=(0!=memcmp( &aOldInfo, theSelectedInfo, sizeof(struct menuInfo))); /* ((aOldInfo.myMenuLanguage != theSelectedInfo->myMenuLanguage) */ /* || (aOldInfo.myKeyboard != theSelectedInfo->myKeyboard) */ /* || (aOldInfo.myKeyboardFeatures.myStickyKeysAreAvailable != theSelectedInfo->myKeyboardFeatures.myStickyKeysAreAvailable) */ /* || (aOldInfo.myKeyboardFeatures.myRepeatKeysAreAvailable != theSelectedInfo->myKeyboardFeatures.myRepeatKeysAreAvailable) */ /* || (aOldInfo.myTextToSpeech.myIdentifier != theSelectedInfo->myTextToSpeech.myIdentifier) */ /* || (aOldInfo.myTextToSpeech.myLanguage != theSelectedInfo->myTextToSpeech.myLanguage) */ /* || (aOldInfo.myTextToSpeech.myPort != theSelectedInfo->myTextToSpeech.myPort) */ /* || (aOldInfo.myDesktop != theSelectedInfo->myDesktop)); */ } }
void PreviewClient::requestToggleOnAllDesktops() { setDesktop(isOnAllDesktops() ? 1 : -1); }