From e88baf8334b8ff7ce92e555cbaffee949672d4b8 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 9 Jan 2013 16:39:31 -0600 Subject: [PATCH] Automatically deactivate disconnected display devices Notify user on display add/remove/change Add advanced display configuration option to krandr menu Add option to autohide kicker panels on inactive Xinerama screens and enable by default Update hwmanager treeview on device change --- kcontrol/displayconfig/displayconfig.cpp | 29 ++++- kcontrol/displayconfig/displayconfig.h | 2 + kcontrol/displayconfig/displayconfigbase.ui | 79 ++++++++----- kcontrol/hwmanager/hwmanager.cpp | 20 +++- kcontrol/hwmanager/hwmanager.h | 1 + kcontrol/kicker/extensionInfo.cpp | 75 +++++++------ kcontrol/kicker/extensionInfo.h | 1 + kcontrol/kicker/hidingtab.ui | 14 +++ kcontrol/kicker/hidingtab_impl.cpp | 8 +- kcontrol/randr/krandrtray.cpp | 118 +++++++++++++------- kcontrol/randr/krandrtray.h | 5 +- kcontrol/taskbar/kcmtaskbar.cpp | 4 + kcontrol/taskbar/kcmtaskbarui.ui | 32 +++--- kicker/kicker/core/container_extension.cpp | 19 +++- kicker/kicker/core/extensionSettings.kcfg | 5 + 15 files changed, 283 insertions(+), 129 deletions(-) diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index faeffa1f5..47c45a3a9 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -447,7 +447,7 @@ void KDisplayConfig::updateDraggableMonitorInformationInternal (int monitor_id, } TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == "Rotate 90 degrees") || (rotationDesired == "Rotate 270 degrees")); + bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); if (screendata->is_extended) { moved_monitor->show(); @@ -742,6 +742,8 @@ void KDisplayConfig::setRealResolutionSliderValue(int index) { KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStringList &) : KCModule(KDisplayCFactory::instance(), parent, name), iccTab(0), m_randrsimple(0), m_gammaApplyTimer(0) { + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); m_randrsimple = new KRandrSimpleAPI(); @@ -773,9 +775,18 @@ KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStrin base->systemEnableSupport->setText(i18n("&Enable local display control for this session")); } - setRootOnlyMsg(i18n("The global display configuration is a system wide setting, and requires administrator access
To alter the system's global display configuration, click on the \"Administrator Mode\" button below.
Otherwise, you may change your session-specific display configuration below.")); +// setRootOnlyMsg(i18n("The global display configuration is a system wide setting, and requires administrator access
To alter the system's global display configuration, click on the \"Administrator Mode\" button below.
Otherwise, you may change your session-specific display configuration below.")); // setUseRootOnlyMsg(true); // Setting this hides the Apply button! + base->nonRootWarningLabel->setFrameShape(TQFrame::Box); + base->nonRootWarningLabel->setFrameShadow(TQFrame::Raised); + if (getuid() != 0) { + base->nonRootWarningLabel->setText(i18n("The global display configuration is a system wide setting, and requires administrator access
To alter the system's global display configuration, click on the \"Administrator Mode\" button below.
Otherwise, you may change your session-specific display configuration below.")); + } + else { + base->nonRootWarningLabel->hide(); + } + connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(processLockoutControls())); connect(base->monitorDisplaySelectDD, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); @@ -833,6 +844,16 @@ KDisplayConfig::~KDisplayConfig() } } +void KDisplayConfig::deviceChanged (TDEGenericDevice* device) { + if (device->type() == TDEGenericDeviceType::Monitor) { + if (base->rescanHardware->isEnabled()) { + base->rescanHardware->setEnabled(false); + rescanHardware(); + base->rescanHardware->setEnabled(true); + } + } +} + void KDisplayConfig::updateExtendedMonitorInformation () { SingleScreenData *screendata; @@ -987,7 +1008,7 @@ void KDisplayConfig::updateDisplayedInformation () { base->orientationVFlip->setChecked(screendata->has_y_flip); } else { - base->rotationSelectDD->insertItem("Normal", 0); + base->rotationSelectDD->insertItem(ROTATION_0_DEGREES_STRING, 0); base->rotationSelectDD->setCurrentItem(0); base->orientationHFlip->hide(); base->orientationVFlip->hide(); @@ -1097,7 +1118,7 @@ void KDisplayConfig::updateDragDropDisplay() { screendata = m_screenInfoArray.at(i); if (((j==0) && (screendata->is_primary==true)) || ((j==1) && (screendata->is_primary==false))) { // This ensures that the primary monitor is always the first one created and placed on the configuration widget TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == "Rotate 90 degrees") || (rotationDesired == "Rotate 270 degrees")); + bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); DraggableMonitor *m = new DraggableMonitor( base->monitorPhyArrange, 0, WStyle_Customize | WDestructiveClose | WStyle_NoBorder | WX11BypassWM ); connect(m, TQT_SIGNAL(workspaceRelayoutNeeded()), this, TQT_SLOT(layoutDragDropDisplay())); connect(m, TQT_SIGNAL(monitorSelected(int)), this, TQT_SLOT(selectScreen(int))); diff --git a/kcontrol/displayconfig/displayconfig.h b/kcontrol/displayconfig/displayconfig.h index 53541d8f8..8f7681c81 100644 --- a/kcontrol/displayconfig/displayconfig.h +++ b/kcontrol/displayconfig/displayconfig.h @@ -35,6 +35,7 @@ #include #include +#include #include "monitorworkspace.h" #include "displayconfigbase.h" @@ -128,6 +129,7 @@ private slots: void gammaTargetChanged (int slotNumber); void dpmsChanged (void); void processDPMSControls (void); + void deviceChanged (TDEGenericDevice*); }; #endif diff --git a/kcontrol/displayconfig/displayconfigbase.ui b/kcontrol/displayconfig/displayconfigbase.ui index 3ea1c57e7..dfa7e57fd 100644 --- a/kcontrol/displayconfig/displayconfigbase.ui +++ b/kcontrol/displayconfig/displayconfigbase.ui @@ -26,7 +26,12 @@ unnamed - + + + nonRootWarningLabel + + + groupSystemSettings @@ -47,7 +52,7 @@ - + Spacer4 @@ -225,7 +230,15 @@ unnamed - + + + textLabel7_9 + + + Rotate screen by: + + + rotationSelectDD @@ -265,36 +278,46 @@ - - rescanHardware - - - &Rescan Displays - + + rescanHardware + + + &Rescan Displays + - - loadExistingProfile - - - Load &Existing Profile - + + loadExistingProfile + + + Load &Existing Profile + - + - previewConfiguration - - - &Test Settings - - - - - identifyMonitors - - - &Identify + layout7 + + + unnamed + + + + previewConfiguration + + + &Test Settings + + + + + identifyMonitors + + + &Identify + + + diff --git a/kcontrol/hwmanager/hwmanager.cpp b/kcontrol/hwmanager/hwmanager.cpp index 36dc89b3e..936a8ab38 100644 --- a/kcontrol/hwmanager/hwmanager.cpp +++ b/kcontrol/hwmanager/hwmanager.cpp @@ -90,7 +90,7 @@ TDEHWManager::TDEHWManager(TQWidget *parent, const char *name, const TQStringLis connect(hwdevices, TQT_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); connect(hwdevices, TQT_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); -// connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView())); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); load(); @@ -188,6 +188,24 @@ void TDEHWManager::populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_con } } +void TDEHWManager::deviceChanged(TDEGenericDevice* device) { + TQListViewItemIterator it(base->deviceTree); + while (it.current()) { + DeviceIconItem* item = dynamic_cast(it.current()); + if (item) { + TDEGenericDevice* candidate = item->device(); + if (candidate) { + if (candidate->systemPath() == device->systemPath()) { + if (item->text(0) != device->friendlyName()) { + item->setText(0, device->friendlyName()); + } + } + } + } + ++it; + } +} + TQString TDEHWManager::quickHelp() const { return i18n("

TDE Hardware Device Manager

This module allows you to configure hardware devices on your system"); diff --git a/kcontrol/hwmanager/hwmanager.h b/kcontrol/hwmanager/hwmanager.h index a7c9749a7..1847f4f33 100644 --- a/kcontrol/hwmanager/hwmanager.h +++ b/kcontrol/hwmanager/hwmanager.h @@ -60,6 +60,7 @@ k_dcop: private slots: void populateTreeView(); void populateTreeViewLeaf(DeviceIconItem *parent, bool show_by_connection, TQString selected_syspath); + void deviceChanged(TDEGenericDevice*); private: TDEHWManagerBase *base; diff --git a/kcontrol/kicker/extensionInfo.cpp b/kcontrol/kicker/extensionInfo.cpp index 88745b9e2..91e19e2d3 100644 --- a/kcontrol/kicker/extensionInfo.cpp +++ b/kcontrol/kicker/extensionInfo.cpp @@ -124,21 +124,22 @@ void ExtensionInfo::load() KConfig c(_configFile); c.setGroup("General"); - _position = c.readNumEntry ("Position", _position); - _alignment = c.readNumEntry ("Alignment", _alignment); - _xineramaScreen = c.readNumEntry ("XineramaScreen", _xineramaScreen); - _showLeftHB = c.readBoolEntry("ShowLeftHideButton", _showLeftHB); - _showRightHB = c.readBoolEntry("ShowRightHideButton", _showRightHB); - _hideButtonSize = c.readNumEntry ("HideButtonSize", _hideButtonSize); - _autohidePanel = c.readBoolEntry("AutoHidePanel", _autohidePanel); - _backgroundHide = c.readBoolEntry("BackgroundHide", _backgroundHide); - _autoHideSwitch = c.readBoolEntry("AutoHideSwitch", _autoHideSwitch); - _autoHideDelay = c.readNumEntry ("AutoHideDelay", _autoHideDelay); - _hideAnim = c.readBoolEntry("HideAnimation", _hideAnim); - _hideAnimSpeed = c.readNumEntry ("HideAnimationSpeed", _hideAnimSpeed); - _unhideLocation = c.readNumEntry ("UnhideLocation", _unhideLocation); - _sizePercentage = c.readNumEntry ("SizePercentage", _sizePercentage); - _expandSize = c.readBoolEntry("ExpandSize", _expandSize); + _position = c.readNumEntry ("Position", _position); + _alignment = c.readNumEntry ("Alignment", _alignment); + _xineramaScreen = c.readNumEntry ("XineramaScreen", _xineramaScreen); + _showLeftHB = c.readBoolEntry("ShowLeftHideButton", _showLeftHB); + _showRightHB = c.readBoolEntry("ShowRightHideButton", _showRightHB); + _hideButtonSize = c.readNumEntry ("HideButtonSize", _hideButtonSize); + _autohidePanel = c.readBoolEntry("AutoHidePanel", _autohidePanel); + _backgroundHide = c.readBoolEntry("BackgroundHide", _backgroundHide); + _autoHideSwitch = c.readBoolEntry("AutoHideSwitch", _autoHideSwitch); + _xineramaHideSwitch = c.readBoolEntry("XineramaHideSwitch", _xineramaHideSwitch); + _autoHideDelay = c.readNumEntry ("AutoHideDelay", _autoHideDelay); + _hideAnim = c.readBoolEntry("HideAnimation", _hideAnim); + _hideAnimSpeed = c.readNumEntry ("HideAnimationSpeed", _hideAnimSpeed); + _unhideLocation = c.readNumEntry ("UnhideLocation", _unhideLocation); + _sizePercentage = c.readNumEntry ("SizePercentage", _sizePercentage); + _expandSize = c.readBoolEntry("ExpandSize", _expandSize); if (_resizeable) { @@ -196,27 +197,28 @@ void ExtensionInfo::configChanged() void ExtensionInfo::setDefaults() { // defaults - _position = 3; - _alignment = TQApplication::reverseLayout() ? 2 : 0; - _xineramaScreen = TQApplication::desktop()->primaryScreen(); - _size = 2; - _showLeftHB = false; - _showRightHB = true; - _hideButtonSize = 14; - _autohidePanel = false; - _backgroundHide = false; - _autoHideSwitch = false; - _autoHideDelay = 3; - _hideAnim = true; - _hideAnimSpeed = 40; - _unhideLocation = 0; - _sizePercentage = 100; - _expandSize = true; - _customSize = 0; - _resizeable = false; - _useStdSizes = false; - _customSizeMin = 0; - _customSizeMax = 0; + _position = 3; + _alignment = TQApplication::reverseLayout() ? 2 : 0; + _xineramaScreen = TQApplication::desktop()->primaryScreen(); + _size = 2; + _showLeftHB = false; + _showRightHB = true; + _hideButtonSize = 14; + _autohidePanel = false; + _backgroundHide = false; + _autoHideSwitch = false; + _xineramaHideSwitch = true; + _autoHideDelay = 3; + _hideAnim = true; + _hideAnimSpeed = 40; + _unhideLocation = 0; + _sizePercentage = 100; + _expandSize = true; + _customSize = 0; + _resizeable = false; + _useStdSizes = false; + _customSizeMin = 0; + _customSizeMax = 0; } void ExtensionInfo::save() @@ -232,6 +234,7 @@ void ExtensionInfo::save() c.writeEntry("AutoHidePanel", _autohidePanel); c.writeEntry("BackgroundHide", _backgroundHide); c.writeEntry("AutoHideSwitch", _autoHideSwitch); + c.writeEntry("XineramaHideSwitch", _xineramaHideSwitch); c.writeEntry("AutoHideDelay", _autoHideDelay); c.writeEntry("HideAnimation", _hideAnim); c.writeEntry("HideAnimationSpeed", _hideAnimSpeed); diff --git a/kcontrol/kicker/extensionInfo.h b/kcontrol/kicker/extensionInfo.h index 169322aa4..8c571011e 100644 --- a/kcontrol/kicker/extensionInfo.h +++ b/kcontrol/kicker/extensionInfo.h @@ -57,6 +57,7 @@ class ExtensionInfo bool _autohidePanel; bool _backgroundHide; bool _autoHideSwitch; + bool _xineramaHideSwitch; int _autoHideDelay; bool _hideAnim; int _hideAnimSpeed; diff --git a/kcontrol/kicker/hidingtab.ui b/kcontrol/kicker/hidingtab.ui index d6b85c046..11ec229b4 100644 --- a/kcontrol/kicker/hidingtab.ui +++ b/kcontrol/kicker/hidingtab.ui @@ -308,6 +308,20 @@
+ + + m_xineramaHide + + + true + + + &Hide panel when configured screen is not available + + + When this option is selected, this panel will be hidden if its Xinerama screen is not available. This panel will be automatically restored when the configured Xinerama screen is reenabked. + + m_autoHideSwitch diff --git a/kcontrol/kicker/hidingtab_impl.cpp b/kcontrol/kicker/hidingtab_impl.cpp index 4a5a36e67..3bde445b8 100644 --- a/kcontrol/kicker/hidingtab_impl.cpp +++ b/kcontrol/kicker/hidingtab_impl.cpp @@ -41,8 +41,9 @@ HidingTab::HidingTab(TQWidget *parent, const char* name) connect(m_manual,TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); connect(m_automatic, TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); connect(m_automatic, TQT_SIGNAL(toggled(bool)), TQT_SLOT(backgroundModeClicked())); - connect(m_background,TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); + connect(m_background, TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); connect(m_background, TQT_SIGNAL(toggled(bool)), TQT_SLOT(backgroundModeClicked())); + connect(m_xineramaHide, TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); connect(m_hideSlider, TQT_SIGNAL(valueChanged(int)), TQT_SIGNAL(changed())); connect(m_delaySpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SIGNAL(changed())); connect(m_animateHiding, TQT_SIGNAL(toggled(bool)), TQT_SIGNAL(changed())); @@ -141,6 +142,8 @@ void HidingTab::switchPanel(int panelItem) m_manual->setChecked(true); } + m_xineramaHide->setChecked(m_panelInfo->_xineramaHideSwitch); + m_delaySpinBox->setValue(m_panelInfo->_autoHideDelay); m_autoHideSwitch->setChecked(m_panelInfo->_autoHideSwitch); @@ -190,6 +193,8 @@ void HidingTab::storeInfo() m_panelInfo->_autoHideDelay = m_delaySpinBox->value(); m_panelInfo->_autoHideSwitch = m_autoHideSwitch->isChecked(); + m_panelInfo->_xineramaHideSwitch = m_xineramaHide->isChecked(); + m_panelInfo->_unhideLocation = m_backgroundRaise->isChecked() ? triggerComboToConfig(m_backgroundPos->currentItem()) : 0; } @@ -199,6 +204,7 @@ void HidingTab::defaults() m_manual->setChecked( true ); m_delaySpinBox->setValue( 3 ); m_autoHideSwitch->setChecked( false ); + m_xineramaHide->setChecked( true ); m_lHB->setChecked( false ); m_rHB->setChecked( true ); m_animateHiding->setChecked( true ); diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp index c3ba773ea..3cfe4cdda 100644 --- a/kcontrol/randr/krandrtray.cpp +++ b/kcontrol/randr/krandrtray.cpp @@ -88,6 +88,9 @@ KRandRSystemTray::KRandRSystemTray(TQWidget* parent, const char *name) if (cur_profile != "") { applyIccConfiguration(cur_profile, NULL); } + + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); } /*! @@ -133,27 +136,73 @@ void KRandRSystemTray::mousePressEvent(TQMouseEvent* e) KSystemTray::mousePressEvent(e); } -void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu) +void KRandRSystemTray::reloadDisplayConfiguration() { - //int lastIndex = 0; - // Reload the randr configuration... XRROutputInfo *output_info; char *output_name; RROutput output_id; int i; - int lastIndex = 0; + int activeOutputs = 0; int screenDeactivated = 0; if (isValid() == true) { randr_screen_info = read_screen_info(randr_display); + // Count outputs in the active state + activeOutputs = 0; for (i = 0; i < randr_screen_info->n_output; i++) { output_info = randr_screen_info->outputs[i]->info; // Look for ON outputs if (!randr_screen_info->outputs[i]->cur_crtc) { continue; } + // Look for CONNECTED outputs + if (RR_Disconnected == randr_screen_info->outputs[i]->info->connection) { + continue; + } + + activeOutputs++; + } + + if (activeOutputs < 1) { + // Houston, we have a problem! + // There are no active displays! + // Activate the first connected display we come across... + for (i = 0; i < randr_screen_info->n_output; i++) { + output_info = randr_screen_info->outputs[i]->info; + // Look for OFF outputs + if (randr_screen_info->outputs[i]->cur_crtc) { + continue; + } + // Look for CONNECTED outputs + if (RR_Disconnected == randr_screen_info->outputs[i]->info->connection) { + continue; + } + + // Activate this output + randr_screen_info->cur_crtc = randr_screen_info->outputs[i]->cur_crtc; + randr_screen_info->cur_output = randr_screen_info->outputs[i]; + randr_screen_info->cur_output->auto_set = 1; + randr_screen_info->cur_output->off_set = 0; + output_auto (randr_screen_info, randr_screen_info->cur_output); + i=main_low_apply(randr_screen_info); + + if (randr_screen_info->outputs[i]->cur_crtc) { + // Output successfully activated! + set_primary_output(randr_screen_info, randr_screen_info->cur_output->id); + break; + } + } + } + + for (i = 0; i < randr_screen_info->n_output; i++) { + output_info = randr_screen_info->outputs[i]->info; + // Look for ON outputs + if (!randr_screen_info->outputs[i]->cur_crtc) { + continue; + } + // Look for DISCONNECTED outputs if (RR_Disconnected != randr_screen_info->outputs[i]->info->connection) { continue; } @@ -176,19 +225,17 @@ void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu) findPrimaryDisplay(); refresh(); - // HACK - // This is needed because Qt does not properly generate screen - // resize events when switching screens, so KDE gets stuck in the old resolution - // This only seems to happen with more than one screen, so check for that condition... - if (kapp->desktop()->numScreens() > 1) { - currentScreen()->proposeSize(GetHackResolutionParameter()); - currentScreen()->applyProposed(); - } - currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); } } +} + +void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu) +{ + int lastIndex = 0; + + reloadDisplayConfiguration(); menu->clear(); menu->setCheckable(true); @@ -236,8 +283,8 @@ void KRandRSystemTray::contextMenuAboutToShow(KPopupMenu* menu) menu->insertTitle(SmallIcon("randr"), i18n("Global Configuation")); - KAction *actColors = new KAction( i18n( "Configure Color Profiles..." ), - SmallIconSet( "configure" ), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotColorConfig() ), + KAction *actColors = new KAction( i18n( "Configure Displays..." ), + SmallIconSet( "configure" ), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotDisplayConfig() ), actionCollection() ); actColors->plug( menu ); @@ -469,12 +516,12 @@ void KRandRSystemTray::slotPrefs() kcm->exec(); } -void KRandRSystemTray::slotColorConfig() +void KRandRSystemTray::slotDisplayConfig() { KCMultiDialog *kcm = new KCMultiDialog( KDialogBase::Plain, i18n( "Configure" ), this ); - kcm->addModule( "iccconfig" ); - kcm->setPlainCaption( i18n( "Configure Display Color Profiles" ) ); + kcm->addModule( "displayconfig" ); + kcm->setPlainCaption( i18n( "Configure Displays" ) ); kcm->exec(); } @@ -596,6 +643,9 @@ void KRandRSystemTray::slotCycleDisplays() i=main_low_apply(randr_screen_info); if (randr_screen_info->outputs[current_on_index]->cur_crtc) { + // Output successfully activated! + set_primary_output(randr_screen_info, randr_screen_info->cur_output->id); + if (prev_on_index != -1) { if (randr_screen_info->outputs[prev_on_index]->cur_crtc != NULL) { if (RR_Disconnected != randr_screen_info->outputs[prev_on_index]->info->connection) { @@ -635,16 +685,6 @@ void KRandRSystemTray::slotCycleDisplays() findPrimaryDisplay(); refresh(); - // HACK - // This is needed because Qt does not properly generate screen - // resize events when switching screens, so KDE gets stuck in the old resolution - // This only seems to happen with more than one screen, so check for that condition... - if (kapp->desktop()->numScreens() > 1) { -// currentScreen()->proposeSize(GetHackResolutionParameter()); -// currentScreen()->applyProposed(); - kapp->desktop()->emitResizedSignal(currentScreenIndex()); - } - currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); } @@ -781,9 +821,7 @@ void KRandRSystemTray::slotOutputChanged(int parameter) { XRROutputInfo *output_info; char *output_name; - RROutput output_id; int i; - Status s; int num_outputs_on; num_outputs_on = 0; @@ -825,15 +863,6 @@ void KRandRSystemTray::slotOutputChanged(int parameter) findPrimaryDisplay(); refresh(); - // HACK - // This is needed because Qt does not properly generate screen - // resize events when switching screens, so KDE gets stuck in the old resolution - // This only seems to happen with more than one screen, so check for that condition... - if (kapp->desktop()->numScreens() > 1) { - currentScreen()->proposeSize(GetHackResolutionParameter()); - currentScreen()->applyProposed(); - } - currentScreen()->proposeSize(GetDefaultResolutionParameter()); currentScreen()->applyProposed(); } @@ -842,3 +871,14 @@ void KRandRSystemTray::slotOutputChanged(int parameter) } } } + +void KRandRSystemTray::deviceChanged (TDEGenericDevice* device) { + if (device->type() == TDEGenericDeviceType::Monitor) { + KRandrPassivePopup::message( + i18n("New display output options are available!"), + i18n("A screen has been added, removed, or changed"), SmallIcon("window_fullscreen"), + this, "ScreenChangeNotification"); + + reloadDisplayConfiguration(); + } +} \ No newline at end of file diff --git a/kcontrol/randr/krandrtray.h b/kcontrol/randr/krandrtray.h index f0d8d7367..60d966a15 100644 --- a/kcontrol/randr/krandrtray.h +++ b/kcontrol/randr/krandrtray.h @@ -25,6 +25,7 @@ #include #include +#include class KHelpMenu; class KPopupMenu; @@ -50,7 +51,7 @@ protected slots: void slotOrientationChanged(int parameter); void slotRefreshRateChanged(int parameter); void slotPrefs(); - void slotColorConfig(); + void slotDisplayConfig(); void slotSKeys(); void slotSettingsChanged(int category); void slotCycleDisplays(); @@ -67,6 +68,7 @@ private: int GetDefaultResolutionParameter(); int GetHackResolutionParameter(); void findPrimaryDisplay(); + void reloadDisplayConfiguration(); bool m_popupUp; KHelpMenu* m_help; @@ -85,6 +87,7 @@ private: private slots: void _quit(); + void deviceChanged (TDEGenericDevice*); }; #endif diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index 25f2c778d..3a2436b24 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -212,6 +212,10 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL { m_widget->showAllScreens->hide(); } + else + { + m_widget->showAllScreens->show(); + } connect( m_widget->showAllScreens, TQT_SIGNAL( stateChanged( int )), TQT_SLOT( changed())); KAboutData *about = new KAboutData(I18N_NOOP("kcmtaskbar"), diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index 6a43b5fbb..ce0ddb6fe 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -71,7 +71,7 @@ By default this option is selected. By default, this option is selected and all windows are shown. - + kcfg_ShowWindowListBtn @@ -85,7 +85,7 @@ By default, this option is selected and all windows are shown. Selecting this option causes the taskbar to display a button that, when clicked, shows a list of all windows in a popup menu. - + kcfg_GroupTasks @@ -105,9 +105,9 @@ You can set the taskbar to <strong>Never</strong> group windows, to By default the taskbar groups windows when it is full. - + - showTaskStatesLabel + groupTasksLabel &Group similar tasks: @@ -116,7 +116,7 @@ By default the taskbar groups windows when it is full. kcfg_ShowTaskStates - + kcfg_ShowTaskStates @@ -132,9 +132,9 @@ By default the taskbar groups windows when it is full. The taskbar can show and/or hide tasks based on their current process state. Select <em>Any</em> to show all tasks regardless of current state. - + - groupTasksLabel + showTaskStatesLabel &Show tasks with state: @@ -143,7 +143,7 @@ By default the taskbar groups windows when it is full. kcfg_ShowTaskStates - + kcfg_ShowOnlyIconified @@ -156,7 +156,7 @@ By default the taskbar groups windows when it is full. By default, this option is not selected and the taskbar will show all windows. - + kcfg_ShowIcon @@ -172,7 +172,7 @@ By default, this option is not selected and the taskbar will show all windows. - + showAllScreens @@ -188,12 +188,12 @@ By default this option is selected. By default, this option is selected and all windows are shown. - + appearance - + textLabel1 @@ -204,7 +204,7 @@ By default, this option is selected and all windows are shown. appearance - + kcfg_UseCustomColors @@ -218,7 +218,7 @@ By default, this option is selected and all windows are shown. true - + layout9 @@ -353,7 +353,7 @@ By default, this option is selected and all windows are shown.
- + kcfg_SortByApp @@ -364,7 +364,7 @@ By default, this option is selected and all windows are shown. true - + kcfg_CycleWheel diff --git a/kicker/kicker/core/container_extension.cpp b/kicker/kicker/core/container_extension.cpp index 80ceb6e13..1b7857774 100644 --- a/kicker/kicker/core/container_extension.cpp +++ b/kicker/kicker/core/container_extension.cpp @@ -476,6 +476,12 @@ void ExtensionContainer::removeSessionConfigFile() void ExtensionContainer::moveMe() { int screen = xineramaScreen(); + if (screen == -3) + { + // we aren't on any screen? um. ok. + return; + } + if (screen < 0) { screen = kapp->desktop()->screenNumber(this); @@ -1980,7 +1986,7 @@ int ExtensionContainer::xineramaScreen() const // sanitize at runtime only, since many Xinerama users // turn it on and off and don't want kicker to lose their configs - /* -2 means all screens, -1 primary screens, the rest are valid screen numbers */ + /* -3 means no screens, -2 means all screens, -1 primary screens, the rest are valid screen numbers */ if (XineramaAllScreens <= m_settings.xineramaScreen() && m_settings.xineramaScreen() < TQApplication::desktop()->numScreens()) { @@ -1988,8 +1994,15 @@ int ExtensionContainer::xineramaScreen() const } else { - /* force invalid screen locations onto the primary screen */ - return TQApplication::desktop()->primaryScreen(); + if (m_settings.xineramaHideSwitch()) + { + return -3; + } + else + { + /* force invalid screen locations onto the primary screen */ + return TQApplication::desktop()->primaryScreen(); + } } } diff --git a/kicker/kicker/core/extensionSettings.kcfg b/kicker/kicker/core/extensionSettings.kcfg index 466f30ce7..12bf9e37c 100644 --- a/kicker/kicker/core/extensionSettings.kcfg +++ b/kicker/kicker/core/extensionSettings.kcfg @@ -60,6 +60,11 @@ false + + + true + + 3