1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Remove LITE config option

Why?

     1. The reason for its existence is to "Disable some stuff that are
        duplicated in kde", and I don't think I will ever need that.
        Furthermore, even the description in the configure script reads
        "disable some stuff (dont use it)".

     2. It makes the code uglier at some places, e.g.,

         #ifdef LITE
                {
         #if 0
                }
         #endif
         #else

                if (!wRootMenuPerformShortcut(event)) {
         #endif

        which by the way is the ugliness which motivated this patch.

     3. Does not even compile anymore. It fails with

          CC dockedapp.o
          CC event.o
       event.c: In function 'executeButtonAction:
       event.c:711: error: WScreen has no member named root_menu
       event.c:712: error: WScreen has no member named root_menu
       event.c:713: error: WScreen has no member named root_menu
       event.c:715: error: WScreen has no member named root_menu
       event.c:720: error: WScreen has no member named switch_menu
       event.c:721: error: WScreen has no member named switch_menu
       event.c:722: error: WScreen has no member named switch_menu
       event.c:724: error: WScreen has no member named switch_menu
       make[2]: *** [event.o] Error 1
       make[1]: *** [all] Error 2
       make: *** [all-recursive] Error 1

       But instead of fixing this (it would be trivial), let's get
       rid of the whole ugliness altogether.
This commit is contained in:
Carlos R. Mafra
2009-08-23 18:25:59 +02:00
parent 874b0fadf5
commit fe736e849c
14 changed files with 6 additions and 89 deletions

View File

@@ -372,18 +372,6 @@ dnl vdesktop_on=yes
dnl fi])
dnl
dnl Disable some stuff that are duplicated in kde
dnl ---------------------------------------------
AC_ARG_ENABLE(lite,
[ --enable-lite disable some stuff (dont use it) ],
[if test x$enableval = xyes; then
LITE=yes
AC_DEFINE(LITE, 1, [define if you want the 'lite' version])
AC_SUBST(LITE)
fi])
dnl
dnl Beautify compilation messages
dnl ---------------------------------------------

View File

@@ -42,9 +42,7 @@ void wUnshadeWindow(WWindow *wwin);
void wIconifyWindow(WWindow *wwin);
void wDeiconifyWindow(WWindow *wwin);
#ifndef LITE
void wSelectWindows(WScreen *scr, XEvent *ev);
#endif
void wSelectWindow(WWindow *wwin, Bool flag);
void wUnselectWindows(WScreen *scr);

View File

@@ -547,12 +547,10 @@ WDefaultEntry optionList[] = {
{"SwitchPanelImages", "(swtile.png, swback.png, 30, 40)", &wPreferences,
NULL, getPropList, setSwPOptions},
/* keybindings */
#ifndef LITE
{"RootMenuKey", "None", (void *)WKBD_ROOTMENU,
NULL, getKeybind, setKeyGrab},
{"WindowListKey", "None", (void *)WKBD_WINDOWLIST,
NULL, getKeybind, setKeyGrab},
#endif /* LITE */
{"WindowMenuKey", "None", (void *)WKBD_WINDOWMENU,
NULL, getKeybind, setKeyGrab},
{"ClipLowerKey", "None", (void *)WKBD_CLIPLOWER,
@@ -1104,7 +1102,7 @@ void wDefaultsCheckDomains(void)
WMReleasePropList(shared_dict);
}
}
#ifndef LITE
if (stat(WDRootMenu->path, &stbuf) >= 0 && WDRootMenu->timestamp < stbuf.st_mtime) {
dict = WMReadPropListFromFile(WDRootMenu->path);
#ifdef HEARTBEAT
@@ -1128,8 +1126,6 @@ void wDefaultsCheckDomains(void)
}
WDRootMenu->timestamp = stbuf.st_mtime;
}
#endif /* !LITE */
}
void wReadDefaults(WScreen * scr, WMPropList * new_dict)

View File

@@ -744,7 +744,6 @@ static void handleButtonPress(XEvent * event)
wBalloonHide(scr);
#endif
#ifndef LITE
if (event->xbutton.window == scr->root_win) {
if (event->xbutton.button == Button1 && wPreferences.mouse_button1 != WA_NONE) {
executeButtonAction(scr, event, wPreferences.mouse_button1);
@@ -758,7 +757,6 @@ static void handleButtonPress(XEvent * event)
wWorkspaceRelativeChange(scr, -1);
}
}
#endif /* !LITE */
desc = NULL;
if (XFindContext(dpy, event->xbutton.subwindow, wWinContext, (XPointer *) & desc) == XCNOENT) {
@@ -1360,14 +1358,8 @@ static void handleKeyPress(XEvent * event)
}
if (command < 0) {
#ifdef LITE
{
#if 0
}
#endif
#else
if (!wRootMenuPerformShortcut(event)) {
#endif
static int dontLoop = 0;
if (dontLoop > 10) {
@@ -1390,7 +1382,7 @@ static void handleKeyPress(XEvent * event)
#define ISFOCUSED(w) ((w) && (w)->flags.focused)
switch (command) {
#ifndef LITE
case WKBD_ROOTMENU:
/*OpenRootMenu(scr, event->xkey.x_root, event->xkey.y_root, True); */
if (!CheckFullScreenWindowFocused(scr)) {
@@ -1406,7 +1398,7 @@ static void handleKeyPress(XEvent * event)
True);
}
break;
#endif /* !LITE */
case WKBD_WINDOWMENU:
if (ISMAPPED(wwin) && ISFOCUSED(wwin))
OpenWindowMenu(wwin, wwin->frame_x, wwin->frame_y + wwin->frame->top_width, True);

View File

@@ -44,9 +44,6 @@ void SetupEnvironment(WScreen *scr);
void DispatchEvent(XEvent *event);
#ifdef LITE
#define UpdateSwitchMenu(a,b,c)
#else
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
Bool wRootMenuPerformShortcut(XEvent *event);
@@ -59,10 +56,6 @@ void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
void InitializeSwitchMenu(void);
#endif /* !LITE */
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);

View File

@@ -32,9 +32,7 @@
#include <stdint.h>
#include <unistd.h>
#include <ctype.h>
#if 0
#include <nana.h>
#endif
#include "WindowMaker.h"
#include "wcore.h"
#include "framewin.h"
@@ -81,19 +79,12 @@ MENU_SCROLL_STEPS_US, MENU_SCROLL_DELAY_US}};
static void menuMouseDown(WObjDescriptor * desc, XEvent * event);
static void menuExpose(WObjDescriptor * desc, XEvent * event);
static void menuTitleDoubleClick(WCoreWindow * sender, void *data, XEvent * event);
static void menuTitleMouseDown(WCoreWindow * sender, void *data, XEvent * event);
static void menuCloseClick(WCoreWindow * sender, void *data, XEvent * event);
static void updateTexture(WMenu * menu);
#ifndef LITE
static int saveMenuRecurs(WMPropList * menus, WScreen * scr, WMenu * menu);
static int restoreMenuRecurs(WScreen * scr, WMPropList * menus, WMenu * menu, char *path);
#endif /* !LITE */
static void selectEntry(WMenu * menu, int entry_no);
static void closeCascade(WMenu * menu);
@@ -2332,7 +2323,6 @@ void wMenuSaveState(WScreen * scr)
menus = WMCreatePLDictionary(NULL, NULL);
#ifndef LITE
if (scr->switch_menu && scr->switch_menu->flags.buttoned) {
key = WMCreatePLString("SwitchMenu");
saveMenuInfo(menus, scr->switch_menu, key);
@@ -2343,7 +2333,6 @@ void wMenuSaveState(WScreen * scr)
if (saveMenuRecurs(menus, scr, scr->root_menu))
save_menus = 1;
#endif /* !LITE */
if (scr->workspace_menu && scr->workspace_menu->flags.buttoned) {
key = WMCreatePLString("WorkspaceMenu");
saveMenuInfo(menus, scr->workspace_menu, key);
@@ -2359,8 +2348,6 @@ void wMenuSaveState(WScreen * scr)
WMReleasePropList(menus);
}
#ifndef LITE
static Bool getMenuPath(WMenu * menu, char *buffer, int bufSize)
{
Bool ok = True;
@@ -2416,7 +2403,6 @@ static Bool saveMenuRecurs(WMPropList * menus, WScreen * scr, WMenu * menu)
}
return save_menus;
}
#endif /* !LITE */
#define COMPLAIN(key) wwarning(_("bad value in menus state info: %s"), key)
@@ -2461,12 +2447,10 @@ static int restoreMenu(WScreen * scr, WMPropList * menu, int which)
if (!getMenuInfo(menu, &x, &y, &lowered))
return False;
#ifndef LITE
if (which & WSS_SWITCHMENU) {
OpenSwitchMenu(scr, x, y, False);
pmenu = scr->switch_menu;
}
#endif /* !LITE */
if (pmenu) {
int width = MENUW(pmenu);
@@ -2494,7 +2478,6 @@ static int restoreMenu(WScreen * scr, WMPropList * menu, int which)
return False;
}
#ifndef LITE
static int restoreMenuRecurs(WScreen * scr, WMPropList * menus, WMenu * menu, char *path)
{
WMPropList *key, *entry;
@@ -2557,7 +2540,6 @@ static int restoreMenuRecurs(WScreen * scr, WMPropList * menus, WMenu * menu, ch
return res;
}
#endif /* !LITE */
void wMenuRestoreState(WScreen * scr)
{
@@ -2581,13 +2563,11 @@ void wMenuRestoreState(WScreen * scr)
WMReleasePropList(skey);
restoreMenu(scr, menu, WSS_SWITCHMENU);
#ifndef LITE
if (!scr->root_menu) {
OpenRootMenu(scr, scr->scr_width * 2, 0, False);
wMenuUnmap(scr->root_menu);
}
restoreMenuRecurs(scr, menus, scr->root_menu, "");
#endif /* !LITE */
}
void OpenWorkspaceMenu(WScreen * scr, int x, int y)
@@ -2595,12 +2575,11 @@ void OpenWorkspaceMenu(WScreen * scr, int x, int y)
WMenu *menu, *parent;
WMenuEntry *entry;
#ifndef LITE
if (!scr->root_menu) {
OpenRootMenu(scr, scr->scr_width * 2, 0, False);
wMenuUnmap(scr->root_menu);
}
#endif
menu = scr->workspace_menu;
if (menu) {
if (menu->flags.mapped) {

View File

@@ -2123,7 +2123,6 @@ void wUnselectWindows(WScreen * scr)
scr->selected_windows = NULL;
}
#ifndef LITE
static void selectWindowsInside(WScreen * scr, int x1, int y1, int x2, int y2)
{
WWindow *tmpw;
@@ -2212,7 +2211,6 @@ void wSelectWindows(WScreen * scr, XEvent * ev)
}
}
}
#endif /* !LITE */
void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned width, unsigned height)
{

View File

@@ -23,8 +23,6 @@
#include "wconfig.h"
#ifndef LITE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -1771,5 +1769,3 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
if (scr->flags.root_menu_changed_shortcuts)
rebindKeygrabs(scr);
}
#endif /* !LITE */

View File

@@ -63,19 +63,12 @@
#include "defaults.h"
#ifdef LITE
#define EVENT_MASK (LeaveWindowMask|EnterWindowMask|PropertyChangeMask\
|SubstructureNotifyMask|PointerMotionMask \
|SubstructureRedirectMask|KeyPressMask|KeyReleaseMask)
#else
#define EVENT_MASK (LeaveWindowMask|EnterWindowMask|PropertyChangeMask\
|SubstructureNotifyMask|PointerMotionMask \
|SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\
|KeyPressMask|KeyReleaseMask)
#endif
/**** Global variables ****/
extern Cursor wCursor[WCUR_LAST];
extern WPreferences wPreferences;
extern Atom _XA_WINDOWMAKER_STATE;
@@ -90,7 +83,6 @@ extern int wXkbSupported;
extern WDDomain *WDWindowMaker;
/**** Local ****/
#define STIPPLE_WIDTH 2
#define STIPPLE_HEIGHT 2
static char STIPPLE_DATA[] = { 0x02, 0x01 };
@@ -960,10 +952,8 @@ void wScreenRestoreState(WScreen * scr)
WMPropList *state;
char *path;
#ifndef LITE
OpenRootMenu(scr, -10000, -10000, False);
wMenuUnmap(scr->root_menu);
#endif
make_keys();

View File

@@ -28,7 +28,6 @@
#include <WINGs/WUtil.h>
#define WTB_LEFT 0
#define WTB_RIGHT 1
@@ -38,7 +37,6 @@
#define WTB_MENU 6
typedef struct {
WMRect *screens;
int count; /* screen count, 0 = inactive */
@@ -216,10 +214,8 @@ typedef struct _WScreen {
struct WPixmap *menu_shade_indicator; /* for shaded window */
int app_menu_x, app_menu_y; /* position for application menus */
#ifndef LITE
struct WMenu *root_menu; /* root window menu */
struct WMenu *switch_menu; /* window list menu */
#endif
struct WMenu *workspace_menu; /* workspace operation */
struct WMenu *window_menu; /* window command menu */
struct WMenu *icon_menu; /* icon/appicon menu */

View File

@@ -776,9 +776,7 @@ void StartUp(Bool defaultScreenOnly)
wScreenCount++;
}
#ifndef LITE
InitializeSwitchMenu();
#endif
/* initialize/restore state for the screens */
for (j = 0; j < wScreenCount; j++) {

View File

@@ -22,8 +22,6 @@
#include "wconfig.h"
#ifndef LITE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -424,5 +422,3 @@ static void wsobserver(void *self, WMNotification * notif)
}
}
#endif /* !LITE */

View File

@@ -2653,9 +2653,7 @@ void wWindowSetKeyGrabs(WWindow * wwin)
wwin->frame->core->window, True, GrabModeAsync, GrabModeAsync);
}
#ifndef LITE
wRootMenuBindShortcuts(wwin->frame->core->window);
#endif
}
void wWindowResetMouseGrabs(WWindow * wwin)

View File

@@ -65,7 +65,6 @@ wmaker.inst: $(srcdir)/wmaker.inst.in ./Makefile
-e "s|#sysconfdir#|$(sysconfdir)/WindowMaker|" \
-e "s|#version#|$(VERSION)|" \
-e "s|#bindir#|$(bindir)|" \
-e "s|#LITE#|@LITE@|" \
$(srcdir)/wmaker.inst.in >wmaker.inst
chmod 755 wmaker.inst