diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-09 16:39:31 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-09 16:39:31 -0600 |
commit | e88baf8334b8ff7ce92e555cbaffee949672d4b8 (patch) | |
tree | caac57be5b2bb29eef81ffb58341829e2571ebb3 | |
parent | 477e956a04dfb244814f274e98a8d6f4beb84f3f (diff) | |
download | tdebase-e88baf8334b8ff7ce92e555cbaffee949672d4b8.tar.gz tdebase-e88baf8334b8ff7ce92e555cbaffee949672d4b8.zip |
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
-rw-r--r-- | kcontrol/displayconfig/displayconfig.cpp | 29 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfig.h | 2 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfigbase.ui | 79 | ||||
-rw-r--r-- | kcontrol/hwmanager/hwmanager.cpp | 20 | ||||
-rw-r--r-- | kcontrol/hwmanager/hwmanager.h | 1 | ||||
-rw-r--r-- | kcontrol/kicker/extensionInfo.cpp | 75 | ||||
-rw-r--r-- | kcontrol/kicker/extensionInfo.h | 1 | ||||
-rw-r--r-- | kcontrol/kicker/hidingtab.ui | 14 | ||||
-rw-r--r-- | kcontrol/kicker/hidingtab_impl.cpp | 8 | ||||
-rw-r--r-- | kcontrol/randr/krandrtray.cpp | 118 | ||||
-rw-r--r-- | kcontrol/randr/krandrtray.h | 5 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.cpp | 4 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbarui.ui | 32 | ||||
-rw-r--r-- | kicker/kicker/core/container_extension.cpp | 19 | ||||
-rw-r--r-- | 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("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>Otherwise, you may change your session-specific display configuration below.")); +// setRootOnlyMsg(i18n("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>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("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>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 <dcopobject.h> #include <libkrandr/libkrandr.h> +#include <tdehardwaredevices.h> #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 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="TQGroupBox" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>nonRootWarningLabel</cstring> + </property> + </widget> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupSystemSettings</cstring> </property> @@ -47,7 +52,7 @@ </widget> </grid> </widget> - <spacer row="1" column="0"> + <spacer row="2" column="0"> <property name="name" stdset="0"> <cstring>Spacer4</cstring> </property> @@ -225,7 +230,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="KComboBox" row="0" column="0" colspan="1"> + <widget class="TQLabel" row="0" column="0" colspan="1"> + <property name="name"> + <cstring>textLabel7_9</cstring> + </property> + <property name="text"> + <string>Rotate screen by:</string> + </property> + </widget> + <widget class="KComboBox" row="1" column="0" colspan="1"> <property name="name"> <cstring>rotationSelectDD</cstring> </property> @@ -265,36 +278,46 @@ </property> </widget> <widget class="KPushButton" row="8" column="0" colspan="1"> - <property name="name"> - <cstring>rescanHardware</cstring> - </property> - <property name="text"> - <string>&Rescan Displays</string> - </property> + <property name="name"> + <cstring>rescanHardware</cstring> + </property> + <property name="text"> + <string>&Rescan Displays</string> + </property> </widget> <widget class="KPushButton" row="8" column="1" colspan="1"> - <property name="name"> - <cstring>loadExistingProfile</cstring> - </property> - <property name="text"> - <string>Load &Existing Profile</string> - </property> + <property name="name"> + <cstring>loadExistingProfile</cstring> + </property> + <property name="text"> + <string>Load &Existing Profile</string> + </property> </widget> - <widget class="KPushButton" row="8" column="2" colspan="1"> + <widget class="TQLayoutWidget" row="8" column="3" colspan="1"> <property name="name"> - <cstring>previewConfiguration</cstring> - </property> - <property name="text"> - <string>&Test Settings</string> - </property> - </widget> - <widget class="KPushButton" row="8" column="3" colspan="1"> - <property name="name"> - <cstring>identifyMonitors</cstring> - </property> - <property name="text"> - <string>&Identify</string> + <cstring>layout7</cstring> </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KPushButton" row="8" column="0" colspan="1"> + <property name="name"> + <cstring>previewConfiguration</cstring> + </property> + <property name="text"> + <string>&Test Settings</string> + </property> + </widget> + <widget class="KPushButton" row="8" column="1" colspan="1"> + <property name="name"> + <cstring>identifyMonitors</cstring> + </property> + <property name="text"> + <string>&Identify</string> + </property> + </widget> + </hbox> </widget> </grid> </widget> 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<DeviceIconItem*>(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("<h1>TDE Hardware Device Manager</h1> 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 @@ </spacer> </hbox> </widget> + <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_xineramaHide</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Hide panel when configured screen is not available</string> + </property> + <property name="whatsThis" stdset="0"> + <string>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.</string> + </property> + </widget> <widget class="TQCheckBox" row="5" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>m_autoHideSwitch</cstring> 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 <kglobalaccel.h> #include <libkrandr/libkrandr.h> +#include <tdehardwaredevices.h> 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.</string> By default, this option is selected and all windows are shown.</string> </property> </widget> - <widget class="TQCheckBox" row="6" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_ShowWindowListBtn</cstring> </property> @@ -85,7 +85,7 @@ By default, this option is selected and all windows are shown.</string> <string>Selecting this option causes the taskbar to display a button that, when clicked, shows a list of all windows in a popup menu.</string> </property> </widget> - <widget class="TQComboBox" row="7" column="2"> + <widget class="TQComboBox" row="8" column="2"> <property name="name"> <cstring>kcfg_GroupTasks</cstring> </property> @@ -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.</string> </property> </widget> - <widget class="TQLabel" row="7" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>showTaskStatesLabel</cstring> + <cstring>groupTasksLabel</cstring> </property> <property name="text"> <string>&Group similar tasks:</string> @@ -116,7 +116,7 @@ By default the taskbar groups windows when it is full.</string> <cstring>kcfg_ShowTaskStates</cstring> </property> </widget> - <widget class="TQComboBox" row="8" column="2"> + <widget class="TQComboBox" row="9" column="2"> <property name="name"> <cstring>kcfg_ShowTaskStates</cstring> </property> @@ -132,9 +132,9 @@ By default the taskbar groups windows when it is full.</string> <string>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.</string> </property> </widget> - <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="9" column="0" rowspan="1" colspan="2"> <property name="name"> - <cstring>groupTasksLabel</cstring> + <cstring>showTaskStatesLabel</cstring> </property> <property name="text"> <string>&Show tasks with state:</string> @@ -143,7 +143,7 @@ By default the taskbar groups windows when it is full.</string> <cstring>kcfg_ShowTaskStates</cstring> </property> </widget> - <widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="5" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_ShowOnlyIconified</cstring> </property> @@ -156,7 +156,7 @@ By default the taskbar groups windows when it is full.</string> By default, this option is not selected and the taskbar will show all windows.</string> </property> </widget> - <widget class="TQCheckBox" row="5" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="6" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_ShowIcon</cstring> </property> @@ -172,7 +172,7 @@ By default, this option is not selected and the taskbar will show all windows.</ By default this option is selected.</string> </property> </widget> - <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>showAllScreens</cstring> </property> @@ -188,12 +188,12 @@ By default this option is selected.</string> By default, this option is selected and all windows are shown.</string> </property> </widget> - <widget class="TQComboBox" row="9" column="2"> + <widget class="TQComboBox" row="10" column="2"> <property name="name"> <cstring>appearance</cstring> </property> </widget> - <widget class="TQLabel" row="9" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="10" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -204,7 +204,7 @@ By default, this option is selected and all windows are shown.</string> <cstring>appearance</cstring> </property> </widget> - <widget class="TQCheckBox" row="10" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="11" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>kcfg_UseCustomColors</cstring> </property> @@ -218,7 +218,7 @@ By default, this option is selected and all windows are shown.</string> <bool>true</bool> </property> </widget> - <widget class="TQLayoutWidget" row="11" column="0" rowspan="1" colspan="3"> + <widget class="TQLayoutWidget" row="12" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>layout9</cstring> </property> @@ -353,7 +353,7 @@ By default, this option is selected and all windows are shown.</string> </size> </property> </spacer> - <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_SortByApp</cstring> </property> @@ -364,7 +364,7 @@ By default, this option is selected and all windows are shown.</string> <bool>true</bool> </property> </widget> - <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="3"> + <widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_CycleWheel</cstring> </property> 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 @@ <default>false</default> </entry> +<entry name="XineramaHideSwitch" type="Bool" > + <label>Auto hide when Xinerama screen is not available</label> + <default>true</default> + </entry> + <entry name="AutoHideDelay" type="Int" > <label>Delay before auto hide</label> <default>3</default> |