From kde-devel Fri Aug 29 04:04:17 2008 From: yinshuiboy Date: Fri, 29 Aug 2008 04:04:17 +0000 To: kde-devel Subject: [PATCH] randr change revert Message-Id: <48B77541.7080100 () gmail ! com> X-MARC-Message: https://marc.info/?l=kde-devel&m=121998273627691 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------000004030403040908090603" This is a multi-part message in MIME format. --------------000004030403040908090603 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit hi all, this is a small problem of randr, when you change something in control panel of randr, and then click 'revert to previous', nothing happens. so i fix it, the reason i think is that m_display->applyProposed apply all changes which actually not happened. this patch applies to kdebase/workspace/kcontrol/randr directory. Greetings, Siyuan Cao --------------000004030403040908090603 Content-Type: text/x-patch; name="randr-change-revert.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="randr-change-revert.patch" Index: krandrmodule.cpp =================================================================== --- krandrmodule.cpp (版本 854190) +++ krandrmodule.cpp (工作副本) @@ -39,6 +39,9 @@ : KCModule(KSSFactory::componentData(), parent) { m_display = new RandRDisplay(); + if ( m_display->needsRefresh() ) + m_display->refresh(); + if (!m_display->isValid()) { QVBoxLayout *topLayout = new QVBoxLayout(this); Index: randrconfig.cpp =================================================================== --- randrconfig.cpp (版本 854190) +++ randrconfig.cpp (工作副本) @@ -159,12 +159,22 @@ output->proposeRect(configuredRect); output->proposeRotation(config->rotation()); output->proposeRefreshRate(config->refreshRate()); + + int change = 0; + if ( output->rect() != configuredRect ) + change |= RandR::ChangeRect; + if ( output->rotation() != config->rotation() ) + change |= RandR::ChangeRotation; + if ( output->refreshRate() != config->refreshRate() ) + change |= RandR::ChangeRate; + output->applyProposed( RandR::ChangeRect, true ); + } else { // user wants to disable this output kDebug() << "Disabling " << output->name(); output->slotDisable(); } } - m_display->applyProposed(); +// m_display->applyProposed(); update(); } --------------000004030403040908090603 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --------------000004030403040908090603--