Changeset View
Changeset View
Standalone View
Standalone View
options.cpp
Show All 35 Lines | |||||
36 | 36 | | |||
37 | #endif //KCMRULES | 37 | #endif //KCMRULES | ||
38 | 38 | | |||
39 | namespace KWin | 39 | namespace KWin | ||
40 | { | 40 | { | ||
41 | 41 | | |||
42 | #ifndef KCMRULES | 42 | #ifndef KCMRULES | ||
43 | 43 | | |||
44 | int currentRefreshRate() | | |||
45 | { | | |||
46 | return Options::currentRefreshRate(); | | |||
47 | } | | |||
48 | | ||||
49 | int Options::currentRefreshRate() | 44 | int Options::currentRefreshRate() | ||
50 | { | 45 | { | ||
51 | int rate = -1; | 46 | int rate = -1; | ||
52 | QString syncScreenName(QLatin1String("primary screen")); | 47 | QString syncScreenName(QLatin1String("primary screen")); | ||
53 | if (options->refreshRate() > 0) { // use manually configured refresh rate | 48 | if (options->refreshRate() > 0) { // use manually configured refresh rate | ||
54 | rate = options->refreshRate(); | 49 | rate = options->refreshRate(); | ||
55 | } else if (Screens::self()->count() > 0) { | 50 | } else if (Screens::self()->count() > 0) { | ||
56 | // prefer the refreshrate calculated from the screens mode information | 51 | // prefer the refreshrate calculated from the screens mode information | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 83 | Options::Options(QObject *parent) | |||
107 | , m_legacyFullscreenSupport(false) | 102 | , m_legacyFullscreenSupport(false) | ||
108 | , m_killPingTimeout(0) | 103 | , m_killPingTimeout(0) | ||
109 | , m_hideUtilityWindowsForInactive(false) | 104 | , m_hideUtilityWindowsForInactive(false) | ||
110 | , m_inactiveTabsSkipTaskbar(false) | 105 | , m_inactiveTabsSkipTaskbar(false) | ||
111 | , m_autogroupSimilarWindows(false) | 106 | , m_autogroupSimilarWindows(false) | ||
112 | , m_autogroupInForeground(false) | 107 | , m_autogroupInForeground(false) | ||
113 | , m_compositingMode(Options::defaultCompositingMode()) | 108 | , m_compositingMode(Options::defaultCompositingMode()) | ||
114 | , m_useCompositing(Options::defaultUseCompositing()) | 109 | , m_useCompositing(Options::defaultUseCompositing()) | ||
115 | , m_compositingInitialized(Options::defaultCompositingInitialized()) | | |||
116 | , m_hiddenPreviews(Options::defaultHiddenPreviews()) | 110 | , m_hiddenPreviews(Options::defaultHiddenPreviews()) | ||
117 | , m_glSmoothScale(Options::defaultGlSmoothScale()) | 111 | , m_glSmoothScale(Options::defaultGlSmoothScale()) | ||
118 | , m_xrenderSmoothScale(Options::defaultXrenderSmoothScale()) | 112 | , m_xrenderSmoothScale(Options::defaultXrenderSmoothScale()) | ||
119 | , m_maxFpsInterval(Options::defaultMaxFpsInterval()) | 113 | , m_maxFpsInterval(Options::defaultMaxFpsInterval()) | ||
120 | , m_refreshRate(Options::defaultRefreshRate()) | 114 | , m_refreshRate(Options::defaultRefreshRate()) | ||
121 | , m_vBlankTime(Options::defaultVBlankTime()) | 115 | , m_vBlankTime(Options::defaultVBlankTime()) | ||
122 | , m_glStrictBinding(Options::defaultGlStrictBinding()) | 116 | , m_glStrictBinding(Options::defaultGlStrictBinding()) | ||
123 | , m_glStrictBindingFollowsDriver(Options::defaultGlStrictBindingFollowsDriver()) | 117 | , m_glStrictBindingFollowsDriver(Options::defaultGlStrictBindingFollowsDriver()) | ||
▲ Show 20 Lines • Show All 486 Lines • ▼ Show 20 Line(s) | |||||
610 | { | 604 | { | ||
611 | if (m_useCompositing == useCompositing) { | 605 | if (m_useCompositing == useCompositing) { | ||
612 | return; | 606 | return; | ||
613 | } | 607 | } | ||
614 | m_useCompositing = useCompositing; | 608 | m_useCompositing = useCompositing; | ||
615 | emit useCompositingChanged(); | 609 | emit useCompositingChanged(); | ||
616 | } | 610 | } | ||
617 | 611 | | |||
618 | void Options::setCompositingInitialized(bool compositingInitialized) | | |||
619 | { | | |||
620 | if (m_compositingInitialized == compositingInitialized) { | | |||
621 | return; | | |||
622 | } | | |||
623 | m_compositingInitialized = compositingInitialized; | | |||
624 | emit compositingInitializedChanged(); | | |||
625 | } | | |||
626 | | ||||
627 | void Options::setHiddenPreviews(int hiddenPreviews) | 612 | void Options::setHiddenPreviews(int hiddenPreviews) | ||
628 | { | 613 | { | ||
629 | if (m_hiddenPreviews == static_cast<HiddenPreviews>(hiddenPreviews)) { | 614 | if (m_hiddenPreviews == static_cast<HiddenPreviews>(hiddenPreviews)) { | ||
630 | return; | 615 | return; | ||
631 | } | 616 | } | ||
632 | m_hiddenPreviews = static_cast<HiddenPreviews>(hiddenPreviews); | 617 | m_hiddenPreviews = static_cast<HiddenPreviews>(hiddenPreviews); | ||
633 | emit hiddenPreviewsChanged(); | 618 | emit hiddenPreviewsChanged(); | ||
634 | } | 619 | } | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 763 | { | |||
782 | // and not kstyle tooltips and vise-versa, we don't read the | 767 | // and not kstyle tooltips and vise-versa, we don't read the | ||
783 | // "EffectNoTooltip" setting from kdeglobals. | 768 | // "EffectNoTooltip" setting from kdeglobals. | ||
784 | 769 | | |||
785 | 770 | | |||
786 | // QToolTip::setGloballyEnabled( d->show_tooltips ); | 771 | // QToolTip::setGloballyEnabled( d->show_tooltips ); | ||
787 | // KDE4 this probably needs to be done manually in clients | 772 | // KDE4 this probably needs to be done manually in clients | ||
788 | 773 | | |||
789 | // Driver-specific config detection | 774 | // Driver-specific config detection | ||
790 | setCompositingInitialized(false); | | |||
791 | reloadCompositingSettings(); | 775 | reloadCompositingSettings(); | ||
792 | 776 | | |||
793 | emit configChanged(); | 777 | emit configChanged(); | ||
794 | } | 778 | } | ||
795 | 779 | | |||
796 | void Options::loadConfig() | 780 | void Options::loadConfig() | ||
797 | { | 781 | { | ||
798 | m_settings->load(); | 782 | m_settings->load(); | ||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | |||||
953 | { | 937 | { | ||
954 | if (!loadCompositingConfig(force)) { | 938 | if (!loadCompositingConfig(force)) { | ||
955 | return; | 939 | return; | ||
956 | } | 940 | } | ||
957 | m_settings->load(); | 941 | m_settings->load(); | ||
958 | syncFromKcfgc(); | 942 | syncFromKcfgc(); | ||
959 | // from now on we've an initial setup and don't have to reload settings on compositing activation | 943 | // from now on we've an initial setup and don't have to reload settings on compositing activation | ||
960 | // see Workspace::setupCompositing(), composite.cpp | 944 | // see Workspace::setupCompositing(), composite.cpp | ||
961 | setCompositingInitialized(true); | | |||
962 | 945 | | |||
963 | // Compositing settings | 946 | // Compositing settings | ||
964 | KConfigGroup config(m_settings->config(), "Compositing"); | 947 | KConfigGroup config(m_settings->config(), "Compositing"); | ||
965 | 948 | | |||
966 | setGlSmoothScale(qBound(-1, config.readEntry("GLTextureFilter", Options::defaultGlSmoothScale()), 2)); | 949 | setGlSmoothScale(qBound(-1, config.readEntry("GLTextureFilter", Options::defaultGlSmoothScale()), 2)); | ||
967 | setGlStrictBindingFollowsDriver(!config.hasKey("GLStrictBinding")); | 950 | setGlStrictBindingFollowsDriver(!config.hasKey("GLStrictBinding")); | ||
968 | if (!isGlStrictBindingFollowsDriver()) { | 951 | if (!isGlStrictBindingFollowsDriver()) { | ||
969 | setGlStrictBinding(config.readEntry("GLStrictBinding", Options::defaultGlStrictBinding())); | 952 | setGlStrictBinding(config.readEntry("GLStrictBinding", Options::defaultGlStrictBinding())); | ||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |