Speed up pseudotrans changes.

SVN revision: 16094
This commit is contained in:
Kim Woelders 2005-08-10 15:31:48 +00:00
parent 9a2ebaf5d7
commit 4e8d728814
3 changed files with 51 additions and 25 deletions

View File

@ -1599,17 +1599,25 @@ EwinsEventsConfigure(int mode)
}
static void
EwinsTouch(void)
EwinsTouch(int desk)
{
int i, num;
EWin *const *lst, *ewin;
lst = EwinListStackGet(&num);
if (desk < 0)
lst = EwinListGetAll(&num);
else
lst = EwinListGetForDesk(&num, desk);
for (i = num - 1; i >= 0; i--)
{
ewin = lst[i];
if (EwinIsMapped(ewin))
if (EwinIsMapped(ewin) && EwinIsOnScreen(ewin))
#if 1 /* FIXME - Which one? */
EwinMove(ewin, EoGetX(ewin), EoGetY(ewin));
#else
EwinResize(ewin, ewin->client.w, ewin->client.h);
#endif
}
}
@ -1872,12 +1880,8 @@ EwinsInit(void)
*/
static void
EwinsSighan(int sig, void *prm __UNUSED__)
EwinsSighan(int sig, void *prm)
{
EWin *ewin;
EWin **ewin_lst;
int win_cnt, i;
switch (sig)
{
case ESIGNAL_INIT:
@ -1894,19 +1898,13 @@ EwinsSighan(int sig, void *prm __UNUSED__)
break;
#endif
case ESIGNAL_DESK_RESIZE:
EwinsTouch();
EwinsTouch(-1);
break;
case ESIGNAL_THEME_TRANS_CHANGE:
EwinsTouch(DesksGetCurrent());
break;
case ESIGNAL_BACKGROUND_CHANGE:
/* FIXME - Only visible windows */
/* FIXME - BG: Only affected desk */
ewin_lst = (EWin **) EwinListStackGet(&win_cnt);
for (i = 0; i < win_cnt; i++)
{
ewin = ewin_lst[i];
if (EwinIsMapped(ewin))
EwinResize(ewin, ewin->client.w, ewin->client.h);
}
EwinsTouch((long)prm);
break;
}
}

View File

@ -91,10 +91,26 @@ TransparencySet(int transparency)
prev_alpha = Conf.trans.alpha;
Conf.trans.alpha = transparency;
}
if (!changed)
return;
/* Generate the color modifier tables */
TransparencyMakeColorModifier();
if (changed)
ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL);
if (prev_alpha == 0)
{
/* Hack to get tiled backgrounds regenerated at full size */
int i, num;
num = DesksGetNumber();
for (i = 0; i < num; i++)
{
BackgroundPixmapFree(DeskGetBackground(i));
DeskRefresh(i);
}
}
ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL);
}
#endif /* ENABLE_THEME_TRANSPARENCY */

View File

@ -39,6 +39,19 @@ static int tmp_st_menu;
static int tmp_st_tooltip;
static int tmp_st_hilight;
static void
TransparencyChangeTimeout(int val, void *data __UNUSED__)
{
TransparencySet(val);
}
static void
TransparencyChange(int val)
{
RemoveTimerEvent("PT-Change");
DoIn("PT-Change", .01, TransparencyChangeTimeout, val, NULL);
}
static void
CB_ConfigureTrans(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
{
@ -72,8 +85,9 @@ CB_ConfigureTrans(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
Conf.trans.pager = ICLASS_ATTR_BG;
Conf.trans.iconbox = ICLASS_ATTR_BG;
Conf.trans.warplist = ICLASS_ATTR_BG;
TransparencySet(tmp_theme_transparency);
#if 0 /* Should not be necessary */
TransparencyChange(tmp_theme_transparency);
#endif
}
autosave();
}
@ -88,10 +102,8 @@ CB_ThemeTransparency(Dialog * d __UNUSED__, int val __UNUSED__, void *data)
Esnprintf(s, sizeof(s), _("Theme transparency: %2d"),
tmp_theme_transparency);
DialogItemSetText(di, s);
DialogDrawItems(tr_sel_dialog, di, 0, 0, 99999, 99999);
/* FIXME - We may not want to do this unless things are speeded up */
TransparencySet(tmp_theme_transparency);
TransparencyChange(tmp_theme_transparency);
}
static void