From e0235bb61b643ee44b2dbabffd8ce76900b99681 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 10 Apr 2001 22:00:41 +0000 Subject: [PATCH] - made "Keep on Top" in the dock/clip menu a checked menu entry. It's _much_ easier to work with it this way. - better naming of options in the clip options menu. - better detection of whether to use EXEC or SHEXEC in WPrefs menu editor. --- ChangeLog | 2 ++ WINGs/host.c | 22 +++++++++++++--------- WPrefs.app/Menu.c | 2 +- src/dock.c | 28 +++++++++++++--------------- wrlib/TODO | 1 + 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6712fa6..fa0bee8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ Changes since version 0.64.0: - When Window Maker calls wmsetbg to set the background, it will consider the value of the DisableDithering option and pass the right switch to wmsetbg. - fixed a memleak in the dialog panels. +- made "Keep on Top" in the dock/clip menu a checked menu entry. It's _much_ + easier to work with it this way. Changes since version 0.63.1: diff --git a/WINGs/host.c b/WINGs/host.c index 212575ae..6f25567f 100644 --- a/WINGs/host.c +++ b/WINGs/host.c @@ -1,7 +1,7 @@ /* * WINGs WMHost function library * - * Copyright (c) 1999-2000 Dan Pascu + * Copyright (c) 1999-2001 Dan Pascu * * 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 @@ -248,11 +248,18 @@ WMFlushHostCache() } +static int +matchAddress(void *item, void *cdata) +{ + return (strcmp((char*) item, (char*) cdata)==0); +} + + Bool WMIsHostEqualToHost(WMHost* hPtr, WMHost* aPtr) { - int i, j; - char *adr1, *adr2; + char *adr; + int i; wassertrv(hPtr!=NULL && aPtr!=NULL, False); @@ -260,12 +267,9 @@ WMIsHostEqualToHost(WMHost* hPtr, WMHost* aPtr) return True; for (i=0; iaddresses); i++) { - adr1 = WMGetFromArray(aPtr->addresses, i); - // use WMFindInArray here --Dan - for (j=0; jaddresses); j++) { - adr2 = WMGetFromArray(hPtr->addresses, j); - if (strcmp(adr1, adr2)==0) - return True; + adr = WMGetFromArray(aPtr->addresses, i); + if (WMFindInArray(hPtr->addresses, matchAddress, adr) != WANotFound) { + return True; } } diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 9f38b777..e18b9f0a 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -1626,7 +1626,7 @@ processData(char *title, ItemData *data) switch (data->type) { case ExecInfo: #if 1 - if (strpbrk(data->param.exec.command, "&$*|>param.exec.command, "&$*|>clientdata); + entry->flags.indicator_on = !(((WDock*)entry->clientdata)->lowered); + wMenuPaint(menu); } @@ -1001,11 +1003,7 @@ updateClipOptionsMenu(WMenu *menu, WDock *dock) /* keep on top */ entry = menu->entries[index]; - if (dock->lowered) { - entry->text = _("Keep on Top"); - } else { - entry->text = _("Allow Lowering"); - } + entry->flags.indicator_on = !dock->lowered; entry->clientdata = dock; /* collapsed */ @@ -1047,6 +1045,9 @@ makeClipOptionsMenu(WScreen *scr) entry = wMenuAddCallback(menu, _("Keep on Top"), toggleLoweredCallback, NULL); + entry->flags.indicator = 1; + entry->flags.indicator_on = 1; + entry->flags.indicator_type = MI_CHECK; entry = wMenuAddCallback(menu, _("Collapsed"), toggleCollapsedCallback, NULL); @@ -1054,19 +1055,19 @@ makeClipOptionsMenu(WScreen *scr) entry->flags.indicator_on = 1; entry->flags.indicator_type = MI_CHECK; - entry = wMenuAddCallback(menu, _("AutoCollapse"), + entry = wMenuAddCallback(menu, _("Autocollapse"), toggleAutoCollapseCallback, NULL); entry->flags.indicator = 1; entry->flags.indicator_on = 1; entry->flags.indicator_type = MI_CHECK; - entry = wMenuAddCallback(menu, _("AutoRaiseLower"), + entry = wMenuAddCallback(menu, _("Autoraise"), toggleAutoRaiseLowerCallback, NULL); entry->flags.indicator = 1; entry->flags.indicator_on = 1; entry->flags.indicator_type = MI_CHECK; - entry = wMenuAddCallback(menu, _("AutoAttract Icons"), + entry = wMenuAddCallback(menu, _("Autoattract Icons"), toggleAutoAttractCallback, NULL); entry->flags.indicator = 1; entry->flags.indicator_on = 1; @@ -1092,6 +1093,9 @@ dockMenuCreate(WScreen *scr, int type) if (type != WM_CLIP) { entry = wMenuAddCallback(menu, _("Keep on Top"), toggleLoweredCallback, NULL); + entry->flags.indicator = 1; + entry->flags.indicator_on = 1; + entry->flags.indicator_type = MI_CHECK; } else { entry = wMenuAddCallback(menu, _("Clip Options"), NULL, NULL); scr->clip_options = makeClipOptionsMenu(scr); @@ -3308,14 +3312,8 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event) if (dock->type == WM_DOCK) { /* keep on top */ entry = dock->menu->entries[index]; - - if (dock->lowered) { - entry->text = _("Keep on Top"); - } else { - entry->text = _("Allow Lowering"); - } + entry->flags.indicator_on = !dock->lowered; entry->clientdata = dock; - dock->menu->flags.realized = 0; } else { /* clip options */ diff --git a/wrlib/TODO b/wrlib/TODO index fb2a9dff..a000d6a5 100644 --- a/wrlib/TODO +++ b/wrlib/TODO @@ -2,3 +2,4 @@ supports PseudoColor and TrueColor in some depths) - Gimp's xcf format? - add clipping code to RCombineArea() +- figure out what is producing those speckles when dithering is used. -- 2.11.4.GIT