diff options
-rw-r--r-- | applnk/tde-games-arcade.directory | 2 | ||||
-rw-r--r-- | applnk/tde-games-board.directory | 2 | ||||
-rw-r--r-- | applnk/tde-games-card.directory | 2 | ||||
-rw-r--r-- | applnk/tde-games-kids.directory | 2 | ||||
-rw-r--r-- | applnk/tde-games-strategy.directory | 2 | ||||
-rw-r--r-- | kappfinder/apps/Games/Board/xboard.desktop | 2 | ||||
-rw-r--r-- | kcontrol/background/crossfade.h | 4 | ||||
-rw-r--r-- | kdesktop/bgmanager.cc | 20 | ||||
-rw-r--r-- | tdm/config.def | 2 | ||||
-rw-r--r-- | twin/compton-tde/common.h | 1 | ||||
-rw-r--r-- | twin/compton-tde/compton.c | 148 | ||||
-rw-r--r-- | twin/kcmtwin/twinoptions/windows.cpp | 114 | ||||
-rw-r--r-- | twin/kcmtwin/twinoptions/windows.h | 8 | ||||
-rw-r--r-- | twin/workspace.cpp | 52 |
14 files changed, 243 insertions, 118 deletions
diff --git a/applnk/tde-games-arcade.directory b/applnk/tde-games-arcade.directory index 9cb912e78..6df9ef678 100644 --- a/applnk/tde-games-arcade.directory +++ b/applnk/tde-games-arcade.directory @@ -70,5 +70,5 @@ Name[xh]=Umqolo wesakhiwo esiphatha ubunzima bento Name[zh_CN]=街机 Name[zh_TW]=大型遊戲機遊戲 Name[zu]=Umhhume -Icon=applications-games_arcade +Icon=package_games_arcade X-TDE-SuppressGenericNames=Game,Arcade Game diff --git a/applnk/tde-games-board.directory b/applnk/tde-games-board.directory index 3abf94aed..ad5bacbd5 100644 --- a/applnk/tde-games-board.directory +++ b/applnk/tde-games-board.directory @@ -77,5 +77,5 @@ Name[vi]=Trò chơi bảng Name[wa]=Djeus d' platea Name[zh_CN]=棋类游戏 Name[zh_TW]=棋盤遊戲 -Icon=applications-games_board +Icon=package_games_board X-TDE-SuppressGenericNames=Game,Board Game diff --git a/applnk/tde-games-card.directory b/applnk/tde-games-card.directory index f249eaf3a..24ea868d1 100644 --- a/applnk/tde-games-card.directory +++ b/applnk/tde-games-card.directory @@ -77,5 +77,5 @@ Name[vi]=Trò chơi thẻ Name[wa]=Cwårdjeus Name[zh_CN]=牌类游戏 Name[zh_TW]=紙牌遊戲 -Icon=applications-games_card +Icon=package_games_card X-TDE-SuppressGenericNames=Game,Card Game diff --git a/applnk/tde-games-kids.directory b/applnk/tde-games-kids.directory index 53dcefe9f..35627e9ac 100644 --- a/applnk/tde-games-kids.directory +++ b/applnk/tde-games-kids.directory @@ -84,5 +84,5 @@ Name[xh]=Imidlalo Yabantwana Name[zh_CN]=儿童游戏 Name[zh_TW]=小孩的遊戲 Name[zu]=Imidlalo yabantwana -Icon=applications-games_kids +Icon=package_games_kids X-TDE-SuppressGenericNames=Game,Game for Children diff --git a/applnk/tde-games-strategy.directory b/applnk/tde-games-strategy.directory index 8bbacc129..2bb956715 100644 --- a/applnk/tde-games-strategy.directory +++ b/applnk/tde-games-strategy.directory @@ -84,4 +84,4 @@ Name[xh]=Amacebo okufumana iinjongo & Amacebo okuzoba Name[zh_CN]=策略游戏 Name[zh_TW]=戰略及策略 Name[zu]=Amaqhinga & Iplani -Icon=applications-games_strategy +Icon=package_games_strategy diff --git a/kappfinder/apps/Games/Board/xboard.desktop b/kappfinder/apps/Games/Board/xboard.desktop index 3a563b4b9..629787663 100644 --- a/kappfinder/apps/Games/Board/xboard.desktop +++ b/kappfinder/apps/Games/Board/xboard.desktop @@ -83,7 +83,7 @@ GenericName[zh_CN]=国际象棋游戏 GenericName[zh_TW]=棋類遊戲 GenericName[zu]=Umdlalo we-Chess Exec=xboard -Icon=applications-games_board +Icon=package_games_board Name=Xboard Name[af]=X-bord Name[bn]=এক্সবোর্ড diff --git a/kcontrol/background/crossfade.h b/kcontrol/background/crossfade.h index dba34a3b4..da589aac4 100644 --- a/kcontrol/background/crossfade.h +++ b/kcontrol/background/crossfade.h @@ -31,8 +31,8 @@ inline TQPixmap crossFade(const TQPixmap &pix1, const TQPixmap &pix2, double r_a mw = pix1.width(); mh = pix1.height(); - int alpha = 0xffff * (1-r_alpha); - + short unsigned int alpha = 0xffff * (1-r_alpha); + XRenderColor clr = { 0, 0, 0, alpha }; XRenderPictureAttributes pa; pa.repeat = True; diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc index adb25d216..7c641dd9d 100644 --- a/kdesktop/bgmanager.cc +++ b/kdesktop/bgmanager.cc @@ -399,8 +399,9 @@ void KBackgroundManager::slotChangeDesktop(int desk) // Do we have this or an identical config already running? for (unsigned i=0; i<m_Renderer.size(); i++) { - if (((m_Renderer[i]->hash() == m_Renderer[edesk]->hash()) && (m_Renderer[i]->isActive())) && (desk != 0)) + if (((m_Renderer[i]->hash() == m_Renderer[edesk]->hash()) && (m_Renderer[i]->isActive())) && (desk != 0)) { return; + } } renderBackground(edesk); @@ -665,7 +666,7 @@ void KBackgroundManager::slotImageDone(int desk) TQApplication::desktop()->screen()->backgroundPixmap() ); } - //TODO Find a way to discover if CrossFade effect needs to run + //TODO Find a way to discover if CrossFade effect needs to run if (mOldScreen){ crossInit = true; m_crossTimer->start(70); @@ -685,17 +686,18 @@ void KBackgroundManager::slotImageDone(int desk) do_cleanup = false; } } - if (m_bExport || !m_bCommon) + if (m_bExport || !m_bCommon) { addCache(pm, r->hash(), desk); - else + } + else { delete pm; + } - if (current) - //exportBackground(desk, realDesktop()); - exportBackground(desk, desk); + if (current) { + exportBackground(desk, realDesktop()); + } - if( do_cleanup ) - { + if( do_cleanup ) { r->saveCacheFile(); r->cleanup(); } diff --git a/tdm/config.def b/tdm/config.def index cea1d7147..29a023a7f 100644 --- a/tdm/config.def +++ b/tdm/config.def @@ -1342,7 +1342,7 @@ Description: Key: ServerTimeout Type: int -Default: 15 +Default: 60 User: core Instance: #:*/ Comment: diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h index 4d9f41090..acaf68651 100644 --- a/twin/compton-tde/common.h +++ b/twin/compton-tde/common.h @@ -36,6 +36,7 @@ // #define DEBUG_GLX_MARK 1 // #define DEBUG_GLX_PAINTREG 1 // #define MONITOR_REPAINT 1 +// #define DEBUG_FADE 1 // Whether to enable PCRE regular expression support in blacklists, enabled // by default diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c index 375a95630..3f9b65e69 100644 --- a/twin/compton-tde/compton.c +++ b/twin/compton-tde/compton.c @@ -105,26 +105,18 @@ int my_exit_code = 3; void write_pid_file(pid_t pid) { #ifdef WRITE_PID_FILE -#ifdef USE_ENV_HOME - const char *home = getenv("HOME"); -#else - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); -#endif const char *filename; - const char *configfile = "/.compton-tde.pid"; - int n = strlen(home)+strlen(configfile)+1; + const char *pidfile = "compton-tde.pid"; + char uidstr[sizeof(uid_t)*8+1]; + sprintf(uidstr, "%d", getuid()); + int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; filename = (char*)malloc(n*sizeof(char)); memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); - - printf("writing '%s' as pidfile\n\n", filename); + strcat(filename, P_tmpdir); + strcat(filename, "/."); + strcat(filename, uidstr); + strcat(filename, "-"); + strcat(filename, pidfile); /* now that we did all that by way of introduction...write the file! */ FILE *pFile; @@ -144,26 +136,18 @@ void write_pid_file(pid_t pid) void delete_pid_file() { #ifdef WRITE_PID_FILE -#ifdef USE_ENV_HOME - const char *home = getenv("HOME"); -#else - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); -#endif const char *filename; - const char *configfile = "/.compton-tde.pid"; - int n = strlen(home)+strlen(configfile)+1; + const char *pidfile = "compton-tde.pid"; + char uidstr[sizeof(uid_t)*8+1]; + sprintf(uidstr, "%d", getuid()); + int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; filename = (char*)malloc(n*sizeof(char)); memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); - - printf("deleting '%s' as pidfile\n\n", filename); + strcat(filename, P_tmpdir); + strcat(filename, "/."); + strcat(filename, uidstr); + strcat(filename, "-"); + strcat(filename, pidfile); /* now that we did all that by way of introduction...delete the file! */ unlink(filename); @@ -257,8 +241,15 @@ run_fade(session_t *ps, win *w, unsigned steps) { return; } - if (!w->fade) +#ifdef DEBUG_FADE + if (w->fade) { + printf_dbgf("(%#010lx): run_fade opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt); + } +#endif + + if (!w->fade) { w->opacity = w->opacity_tgt; + } else if (steps) { // Use double below because opacity_t will probably overflow during // calculations @@ -291,6 +282,9 @@ set_fade_callback(session_t *ps, win *w, w->fade_callback = callback; // Must be the last line as the callback could destroy w! if (exec_callback && old_callback) { +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): exec callback\n", w->id); +#endif old_callback(ps, w); // Although currently no callback function affects window state on // next paint, it could, in the future @@ -2403,6 +2397,10 @@ map_win(session_t *ps, Window id) { w->in_openclose = true; set_fade_callback(ps, w, finish_map_win, true); win_determine_fade(ps, w); + if (w->fade) { + // Make sure the new window fades in properly + w->opacity = 0; + } win_determine_blur_background(ps, w); @@ -2421,14 +2419,25 @@ map_win(session_t *ps, Window id) { cdbus_ev_win_mapped(ps, w); } #endif + +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): map_win opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt); +#endif } static void finish_map_win(session_t *ps, win *w) { w->in_openclose = false; +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx)\n", w->id); +#endif if (ps->o.no_fading_openclose) { win_determine_fade(ps, w); } +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): finish_map_win opacity: %u target: %u\n", w->id, w->opacity, w->opacity_tgt); + printf_dbgf("(%#010lx): end\n", w->id); +#endif } static void @@ -2667,8 +2676,12 @@ static void calc_opacity(session_t *ps, win *w) { opacity_t opacity = OPAQUE; - if (w->destroyed || IsViewable != w->a.map_state) + if (w->destroyed || IsViewable != w->a.map_state) { +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): calc_opacity forcing full transparency\n"); +#endif opacity = 0; + } else { // Try obeying opacity property and window type opacity firstly if (OPAQUE == (opacity = w->opacity_prop) @@ -2687,6 +2700,9 @@ calc_opacity(session_t *ps, win *w) { opacity = ps->o.active_opacity; } +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): calc_opacity opacity: %u\n", w->id, opacity); +#endif w->opacity_tgt = opacity; } @@ -2718,14 +2734,29 @@ calc_dim(session_t *ps, win *w) { */ static void win_determine_fade(session_t *ps, win *w) { - if (UNSET != w->fade_force) - w->fade = w->fade_force; - else if (ps->o.no_fading_opacitychange && (!w->in_openclose)) + if (UNSET != w->fade_force) { +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): fade forced\n", w->id); +#endif + w->fade = w->fade_force; + } + else if (ps->o.no_fading_openclose && (w->in_openclose || w->destroyed)) { +#ifdef DEBUG_FADE + printf_dbgf("(): no_fading_openclose and in_openclose\n"); +#endif w->fade = false; - else if (ps->o.no_fading_openclose && w->in_openclose) + } + else if (ps->o.no_fading_opacitychange && (!w->in_openclose)) { +#ifdef DEBUG_FADE + printf_dbgf("(): no_fading_opacitychange and !in_openclose\n"); +#endif w->fade = false; + } else if (ps->o.no_fading_destroyed_argb && w->destroyed && WMODE_ARGB == w->mode && w->client_win && w->client_win != w->id) { +#ifdef DEBUG_FADE + printf_dbgf("(): no_fading_destroyed_argb\n"); +#endif w->fade = false; // Prevent it from being overwritten by last-paint value w->fade_last = false; @@ -2733,11 +2764,29 @@ win_determine_fade(session_t *ps, win *w) { // Ignore other possible causes of fading state changes after window // gets unmapped else if (IsViewable != w->a.map_state) { +#ifdef DEBUG_FADE + printf_dbgf("(): ignored: !IsViewable\n"); +#endif } - else if (win_match(ps, w, ps->o.fade_blacklist, &w->cache_fblst)) + else if (win_match(ps, w, ps->o.fade_blacklist, &w->cache_fblst)) { + w->fade = false; - else - w->fade = ps->o.wintype_fade[w->window_type]; + } + else if (ps->o.wintype_fade[w->window_type] != NULL) { + w->fade = ps->o.wintype_fade[w->window_type]; +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): via wintype_fade[%s]\n", + w->id, WINTYPES[w->window_type]); +#endif + } else { +#ifdef DEBUG_FADE + printf_dbgf("(): fallthrough\n"); +#endif + } + +#ifdef DEBUG_FADE + printf_dbgf("(%#010lx): fade = %d\n", w->id, w->fade ? w->fade : NULL); +#endif } /** @@ -3006,8 +3055,9 @@ calc_win_size(session_t *ps, win *w) { */ static void calc_shadow_geometry(session_t *ps, win *w) { - w->shadow_dx = ps->o.shadow_offset_x * w->shadow_size; - w->shadow_dy = ps->o.shadow_offset_y * w->shadow_size; + static const int shadowRadius = 100; + w->shadow_dx = (((- ps->o.shadow_radius * 7 / 5) - ps->o.shadow_offset_x * shadowRadius / 100) * w->shadow_size) / 100; + w->shadow_dy = (((- ps->o.shadow_radius * 7 / 5) - ps->o.shadow_offset_y * shadowRadius / 100) * w->shadow_size) / 100; w->shadow_width = w->widthb + ps->gaussian_map->size; w->shadow_height = w->heightb + ps->gaussian_map->size; } @@ -6065,7 +6115,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) { for (i = 0; i < NUM_WINTYPES; ++i) { ps->o.wintype_fade[i] = false; - ps->o.wintype_shadow[i] = false; + ps->o.wintype_shadow[i] = true; ps->o.wintype_opacity[i] = 1.0; } @@ -7269,8 +7319,8 @@ session_init(session_t *ps_old, int argc, char **argv) { .shadow_green = 0.0, .shadow_blue = 0.0, .shadow_radius = 12, - .shadow_offset_x = -15, - .shadow_offset_y = -15, + .shadow_offset_x = 0, + .shadow_offset_y = 0, .shadow_opacity = .75, .clear_shadow = false, .shadow_blacklist = NULL, @@ -7642,8 +7692,6 @@ session_init(session_t *ps_old, int argc, char **argv) { cxinerama_upd_scrs(ps); - fprintf(stderr, "Started\n"); - // Create registration window if (!ps->reg_win && !register_cm(ps)) exit(1); diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp index ad207014f..04ca993b3 100644 --- a/twin/kcmtwin/twinoptions/windows.cpp +++ b/twin/kcmtwin/twinoptions/windows.cpp @@ -3,6 +3,7 @@ * * Copyright (c) 1997 Patrick Dowler [email protected] * Copyright (c) 2001 Waldo Bastian [email protected] + * Copyright (c) 2011-2014 Timothy Pearson <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1346,8 +1347,11 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, useOpenGL = new TQCheckBox(i18n("Use OpenGL compositor (best performance)"),tGroup); vLay->addWidget(useOpenGL); + blurBackground = new TQCheckBox(i18n("Blur the background of transparent windows"),tGroup); + vLay->addWidget(blurBackground); if (TDECompositor != "compton-tde") { useOpenGL->hide(); + blurBackground->hide(); } vLay->addStretch(); @@ -1359,6 +1363,14 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, vLay2->addSpacing(11); // to get the proper gb top offset useShadows = new TQCheckBox(i18n("Use shadows (standard effects should be disabled in the Styles module if this is checked)"),sGroup); vLay2->addWidget(useShadows); + useShadowsOnMenuWindows = new TQCheckBox(i18n("Use shadows on menus (requires menu fade effect to be disabled in the Styles module)"),sGroup); + vLay2->addWidget(useShadowsOnMenuWindows); + useShadowsOnToolTipWindows = new TQCheckBox(i18n("Use shadows on tooltips"),sGroup); + vLay2->addWidget(useShadowsOnToolTipWindows); + if (TDECompositor != "compton-tde") { + useShadowsOnMenuWindows->hide(); + useShadowsOnToolTipWindows->hide(); + } vLay2->addSpacing(11); @@ -1438,6 +1450,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, fadeInWindows = new TQCheckBox(i18n("Fade-in windows (including popups)"),eGroup); fadeInMenuWindows = new TQCheckBox(i18n("Fade-in menus (requires menu fade effect to be disabled in the Styles module)"),eGroup); + fadeInToolTipWindows = new TQCheckBox(i18n("Fade-in tooltips"),eGroup); fadeOnOpacityChange = new TQCheckBox(i18n("Fade between opacity changes"),eGroup); fadeInSpeed = new KIntNumInput(100, eGroup); fadeInSpeed->setRange(1,100); @@ -1447,6 +1460,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, fadeOutSpeed->setLabel(i18n("Fade-out speed:")); vLay3->addWidget(fadeInWindows); vLay3->addWidget(fadeInMenuWindows); + vLay3->addWidget(fadeInToolTipWindows); vLay3->addWidget(fadeOnOpacityChange); vLay3->addWidget(fadeInSpeed); vLay3->addWidget(fadeOutSpeed); @@ -1474,7 +1488,11 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(keepAboveAsActive, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(useOpenGL, TQT_SIGNAL(toggled(bool)), blurBackground, TQT_SLOT(setEnabled(bool))); + connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(removeShadowsOnResize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(removeShadowsOnMove, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); @@ -1492,18 +1510,14 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(shadowColor, TQT_SIGNAL(changed(const TQColor&)), TQT_SLOT(changed())); connect(fadeInWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(fadeInMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(fadeInToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(fadeOnOpacityChange, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); connect(fadeInSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); connect(fadeOutSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(useShadows, TQT_SIGNAL(toggled(bool)), dockWindowShadowSize, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), menuWindowShadowSize, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), activeWindowShadowSize, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), inactiveWindowShadowSize, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), baseShadowSize, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowTopOffset, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowLeftOffset, TQT_SLOT(setEnabled(bool))); - connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowColor, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); + connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); + connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); load(); @@ -1515,7 +1529,10 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(useTranslucency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(inactiveWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); connect(baseShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); connect(shadowTopOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); @@ -1523,6 +1540,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, connect(shadowColor, TQT_SIGNAL(changed(const TQColor&)), TQT_SLOT(resetKompmgr())); connect(fadeInWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(fadeInMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(fadeInToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(fadeOnOpacityChange, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); connect(fadeInSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); connect(fadeOutSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); @@ -1530,6 +1548,20 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, } } +void KTranslucencyConfig::processShadowLockouts() +{ + bool enabled = (useShadows->isChecked() || useShadowsOnMenuWindows->isChecked() || useShadowsOnToolTipWindows->isChecked()); + + dockWindowShadowSize->setEnabled(enabled); + menuWindowShadowSize->setEnabled(enabled); + activeWindowShadowSize->setEnabled(enabled); + inactiveWindowShadowSize->setEnabled(enabled); + baseShadowSize->setEnabled(enabled); + shadowTopOffset->setEnabled(enabled); + shadowLeftOffset->setEnabled(enabled); + shadowColor->setEnabled(enabled); +} + void KTranslucencyConfig::resetKompmgr() { resetKompmgr_ = TRUE; @@ -1573,12 +1605,16 @@ void KTranslucencyConfig::load( void ) disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE)); useOpenGL->setChecked(conf_.readBoolEntry("useOpenGL",FALSE)); + blurBackground->setChecked(conf_.readBoolEntry("blurBackground",FALSE)); + blurBackground->setEnabled(useOpenGL->isChecked()); useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0); - shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-200))); - shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",-200))); + useShadowsOnMenuWindows->setChecked(conf_.readBoolEntry("ShadowsOnMenuWindows",TRUE)); + useShadowsOnToolTipWindows->setChecked(conf_.readBoolEntry("ShadowsOnToolTipWindows",TRUE)); + shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",0))); + shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",0))); - int ss = conf_.readNumEntry("ShadowRadius",6); + int ss = conf_.readNumEntry("ShadowRadius",4); dockWindowShadowSize->setValue((int)(dss/100.0)); menuWindowShadowSize->setValue((int)(mss/100.0)); activeWindowShadowSize->setValue((int)(ass/100.0)); @@ -1595,7 +1631,8 @@ void KTranslucencyConfig::load( void ) shadowColor->setColor(TQColor(r,g,b)); fadeInWindows->setChecked(conf_.readBoolEntry("FadeWindows",FALSE)); - fadeInMenuWindows->setChecked(conf_.readBoolEntry("FadeMenuWindows",FALSE)); + fadeInMenuWindows->setChecked(conf_.readBoolEntry("FadeMenuWindows",TRUE)); + fadeInToolTipWindows->setChecked(conf_.readBoolEntry("FadeToolTipWindows",TRUE)); fadeOnOpacityChange->setChecked(conf_.readBoolEntry("FadeTrans",FALSE)); fadeInSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeInStep",0.070)*1000.0)); fadeOutSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeOutStep",0.070)*1000.0)); @@ -1641,8 +1678,11 @@ void KTranslucencyConfig::save( void ) conf_->setGroup("xcompmgr"); conf_->writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":""); + conf_->writeEntry("ShadowsOnMenuWindows",useShadowsOnMenuWindows->isChecked()); + conf_->writeEntry("ShadowsOnToolTipWindows",useShadowsOnToolTipWindows->isChecked()); conf_->writeEntry("DisableARGB",disableARGB->isChecked()); conf_->writeEntry("useOpenGL",useOpenGL->isChecked()); + conf_->writeEntry("blurBackground",blurBackground->isChecked()); conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value()); conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value()); @@ -1655,6 +1695,7 @@ void KTranslucencyConfig::save( void ) conf_->writeEntry("ShadowRadius",baseShadowSize->value()); conf_->writeEntry("FadeWindows",fadeInWindows->isChecked()); conf_->writeEntry("FadeMenuWindows",fadeInMenuWindows->isChecked()); + conf_->writeEntry("FadeToolTipWindows",fadeInToolTipWindows->isChecked()); conf_->writeEntry("FadeTrans",fadeOnOpacityChange->isChecked()); conf_->writeEntry("FadeInStep",fadeInSpeed->value()/1000.0); conf_->writeEntry("FadeOutStep",fadeOutSpeed->value()/1000.0); @@ -1666,6 +1707,10 @@ void KTranslucencyConfig::save( void ) if ( compton_conf_file_->open( IO_WriteOnly ) ) { TQTextStream stream(compton_conf_file_); + stream << "# WARNING\n"; + stream << "# This file was automatically generated by TDE\n"; + stream << "# All changes will be lost!\n"; + stream << "shadow = " << (useShadows->isChecked()?"true":"false") << ";\n"; stream << "shadow-offset-y = " << (-1*shadowTopOffset->value()) << ";\n"; stream << "shadow-offset-x = " << (-1*shadowLeftOffset->value()) << ";\n"; @@ -1681,14 +1726,31 @@ void KTranslucencyConfig::save( void ) bool fadeOpacity = fadeOnOpacityChange->isChecked(); bool fadeWindows = fadeInWindows->isChecked(); bool fadeMenuWindows = fadeInMenuWindows->isChecked(); + bool fadeToolTipWindows = fadeInToolTipWindows->isChecked(); + bool shadows = useShadows->isChecked(); + bool shadowsOnMenuWindows = useShadowsOnMenuWindows->isChecked(); + bool shadowsOnToolTipWindows = useShadowsOnToolTipWindows->isChecked(); stream << "fading = " << ((fadeWindows || fadeMenuWindows || fadeOpacity)?"true":"false") << ";\n"; stream << "no-fading-opacitychange = " << (fadeOpacity?"false":"true") << ";\n"; - stream << "no-fading-openclose = " << (fadeWindows?"false":"true") << ";\n"; + stream << "no-fading-openclose = " << ((fadeWindows||fadeMenuWindows)?"false":"true") << ";\n"; stream << "wintypes:" << "\n"; stream << "{" << "\n"; - stream << " menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; - stream << " dropdown_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; - stream << " popup_menu = { no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; + stream << " menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; + stream << " dropdown_menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; + stream << " popup_menu = { shadow = " << (shadowsOnMenuWindows?"true":"false") << "; fade = " << (fadeMenuWindows?"true":"false") << "; no-fading-openclose = " << (fadeMenuWindows?"false":"true") << "; }" << "\n"; + stream << " tooltip = { shadow = " << (shadowsOnToolTipWindows?"true":"false") << "; fade = " << (fadeToolTipWindows?"true":"false") << "; no-fading-openclose = " << (fadeToolTipWindows?"false":"true") << "; }" << "\n"; + stream << " normal = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " dialog = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " unknown = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " toolbar = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " utility = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " splash = { shadow = " << (shadows?"true":"false") << "; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + + stream << " notify = { shadow = false; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " combo = { shadow = false; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " desktop = { shadow = false; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " dnd = { shadow = false; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; + stream << " dock = { shadow = false; fade = " << (fadeWindows?"true":"false") << "; no-fading-openclose = " << (fadeWindows?"false":"true") << "; }" << "\n"; stream << "}" << "\n"; stream << "fade-in-step = " << (fadeInSpeed->value()/1000.0) << ";\n"; @@ -1697,11 +1759,18 @@ void KTranslucencyConfig::save( void ) stream << "backend = \"" << (useOpenGL->isChecked()?"glx":"xrender") << "\";\n"; stream << "vsync = \"" << (useOpenGL->isChecked()?"opengl":"none") << "\";\n"; + stream << "blur-background = \"" << ((blurBackground->isChecked() && useOpenGL->isChecked())?"true":"false") << "\";\n"; + stream << "blur-background-fixed = true;\n"; + stream << "blur-background-exclude = [\n"; + stream << " \"window_type = 'dock'\",\n"; + stream << " \"window_type = 'desktop'\"\n"; + stream << "];\n"; + // Global settings stream << "no-dock-shadow = true;\n"; stream << "no-dnd-shadow = true;\n"; stream << "clear-shadow = true;\n"; - stream << "shadow-ignore-shaped = true;\n"; + stream << "shadow-ignore-shaped = false;\n"; // Features not currently supported by compton // stream << "DisableARGB = " << (disableARGB->isChecked()?"true":"false") << ";\n"; @@ -1746,20 +1815,23 @@ void KTranslucencyConfig::defaults() menuWindowShadowSize->setValue(1); activeWindowShadowSize->setValue(2); inactiveWindowShadowSize->setValue(1); - baseShadowSize->setValue(1); - shadowTopOffset->setValue(200); - shadowLeftOffset->setValue(200); + baseShadowSize->setValue(4); + shadowTopOffset->setValue(0); + shadowLeftOffset->setValue(0); activeWindowOpacity->setEnabled(false); inactiveWindowOpacity->setEnabled(false); movingWindowOpacity->setEnabled(false); dockWindowOpacity->setEnabled(false); useShadows->setChecked(FALSE); + useShadowsOnMenuWindows->setChecked(TRUE); + useShadowsOnToolTipWindows->setChecked(TRUE); removeShadowsOnMove->setChecked(FALSE); removeShadowsOnResize->setChecked(FALSE); shadowColor->setColor(Qt::black); fadeInWindows->setChecked(FALSE); - fadeInMenuWindows->setChecked(FALSE); + fadeInMenuWindows->setChecked(TRUE); + fadeInToolTipWindows->setChecked(TRUE); fadeOnOpacityChange->setChecked(FALSE); fadeInSpeed->setValue(70); fadeOutSpeed->setValue(70); diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h index 27ea02a8d..facde4136 100644 --- a/twin/kcmtwin/twinoptions/windows.h +++ b/twin/kcmtwin/twinoptions/windows.h @@ -3,6 +3,7 @@ * * Copyright (c) 1997 Patrick Dowler [email protected] * Copyright (c) 2001 Waldo Bastian [email protected] + * Copyright (c) 2011-2014 Timothy Pearson <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -259,10 +260,14 @@ private: TQCheckBox *keepAboveAsActive; TQCheckBox *disableARGB; TQCheckBox *useOpenGL; + TQCheckBox *blurBackground; TQCheckBox *fadeInWindows; TQCheckBox *fadeInMenuWindows; + TQCheckBox *fadeInToolTipWindows; TQCheckBox *fadeOnOpacityChange; TQCheckBox *useShadows; + TQCheckBox *useShadowsOnMenuWindows; + TQCheckBox *useShadowsOnToolTipWindows; TQCheckBox *removeShadowsOnResize; TQCheckBox *removeShadowsOnMove; TQGroupBox *sGroup; @@ -283,7 +288,7 @@ private: KIntNumInput *fadeOutSpeed; KColorButton *shadowColor; TDEConfig *config; - bool standAlone; + bool standAlone; bool alphaActivated; bool resetKompmgr_; bool kompmgrAvailable(); @@ -295,6 +300,7 @@ private: private slots: void resetKompmgr(); void showWarning(bool alphaActivated); + void processShadowLockouts(); }; #endif diff --git a/twin/workspace.cpp b/twin/workspace.cpp index 210ab7754..b6b1e2f62 100644 --- a/twin/workspace.cpp +++ b/twin/workspace.cpp @@ -234,22 +234,20 @@ Workspace::Workspace( bool restore ) } else if (!disable_twin_composition_manager) { - // If kompmgr is already running, send it SIGTERM - // Attempt to load the kompmgr pid file - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); + // If compton-tde is already running, send it SIGTERM + // Attempt to load the compton-tde pid file char *filename; - const char *configfile = "/.kompmgr.pid"; - int n = strlen(home)+strlen(configfile)+1; + const char *pidfile = "compton-tde.pid"; + char uidstr[sizeof(uid_t)*8+1]; + sprintf(uidstr, "%d", getuid()); + int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; filename = (char*)malloc(n*sizeof(char)); memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); + strcat(filename, P_tmpdir); + strcat(filename, "/."); + strcat(filename, uidstr); + strcat(filename, "-"); + strcat(filename, pidfile); // Now that we did all that by way of introduction...read the file! FILE *pFile; @@ -258,7 +256,7 @@ Workspace::Workspace( bool restore ) int kompmgrpid = 0; if (pFile) { - printf("[twin-workspace] Using '%s' as kompmgr pidfile\n\n", filename); + printf("[twin-workspace] Using '%s' as compton-tde pidfile\n\n", filename); // obtain file size fseek (pFile , 0 , SEEK_END); unsigned long lSize = ftell (pFile); @@ -1085,22 +1083,20 @@ void Workspace::slotReconfigure() { bool tmp = options->useTranslucency; - // If kompmgr is already running, sending SIGUSR2 will force a reload of its settings - // Attempt to load the kompmgr pid file - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); + // If compton-tde is already running, sending SIGUSR2 will force a reload of its settings + // Attempt to load the compton-tde pid file char *filename; - const char *configfile = "/.kompmgr.pid"; - int n = strlen(home)+strlen(configfile)+1; + const char *pidfile = "compton-tde.pid"; + char uidstr[sizeof(uid_t)*8+1]; + sprintf(uidstr, "%d", getuid()); + int n = strlen(P_tmpdir)+strlen(uidstr)+strlen(pidfile)+3; filename = (char*)malloc(n*sizeof(char)); memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); + strcat(filename, P_tmpdir); + strcat(filename, "/."); + strcat(filename, uidstr); + strcat(filename, "-"); + strcat(filename, pidfile); // Now that we did all that by way of introduction...read the file! FILE *pFile; @@ -1109,7 +1105,7 @@ void Workspace::slotReconfigure() int kompmgrpid = 0; if (pFile) { - printf("[twin-workspace] Using '%s' as kompmgr pidfile\n\n", filename); + printf("[twin-workspace] Using '%s' as compton-tde pidfile\n\n", filename); // obtain file size fseek (pFile , 0 , SEEK_END); unsigned long lSize = ftell (pFile); |