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

reverted the last test commit (duh)

This commit is contained in:
dan
2004-07-16 18:50:58 +00:00
parent 109bb540ec
commit 474c4caf94
42 changed files with 1668 additions and 2053 deletions

View File

@@ -104,9 +104,7 @@ wmaker_SOURCES = \
text.h
AM_CPPFLAGS = $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
AM_CFLAGS = -fno-strict-aliasing
AM_CPPFLAGS = @CPPFLAGS@ $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
INCLUDES = \

View File

@@ -407,7 +407,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
result = wIconChooserDialog(scr, &file, icon->wm_instance, icon->wm_class);
if (result && !icon->destroyed) {
if (file && *file==0) {
if (file[0]==0) {
wfree(file);
file = NULL;
}

View File

@@ -198,9 +198,7 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
if (hasModifier) {
keymap = XGetModifierMapping(dpy);
#ifdef DEBUG
printf("Grabbing keyboard\n");
#endif
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync,
CurrentTime);
}
@@ -225,6 +223,11 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
wWindowFocus(newFocused, scr->focused_window);
oldFocused = newFocused;
if (hasModifier)
done = False;
else
done = True;
#if 0
if (wPreferences.popup_switchmenu &&
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
@@ -233,9 +236,8 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
openedSwitchMenu = True;
}
#endif
while (hasModifier && !done) {
WMMaskEvent(dpy, KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
while (!done) {
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
if (ev.type != KeyRelease && ev.type != KeyPress) {
WMHandleEvent(&ev);
@@ -245,10 +247,7 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
modifiers = ev.xkey.state & ValidModMask;
if (ev.type == KeyPress) {
#ifdef DEBUG
printf("Got key press\n");
#endif
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
newFocused = nextToFocusAfter(newFocused);
@@ -275,18 +274,12 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
}
} else {
#ifdef DEBUG
printf("Got something else\n");
#endif
somethingElse = True;
done = True;
}
} else if (ev.type == KeyRelease) {
int i;
#ifdef DEBUG
printf("Got key release\n");
#endif
for (i = 0; i < 8 * keymap->max_keypermod; i++) {
if (keymap->modifiermap[i] == ev.xkey.keycode &&
wKeyBindings[WKBD_FOCUSNEXT].modifier
@@ -301,9 +294,6 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
XFreeModifiermap(keymap);
if (hasModifier) {
#ifdef DEBUG
printf("Ungrabbing keyboard\n");
#endif
XUngrabKeyboard(dpy, CurrentTime);
}
wSetFocusTo(scr, newFocused);

View File

@@ -636,7 +636,6 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
IconPanel *panel;
WMColor *color;
WMFont *boldFont;
Bool result;
panel = wmalloc(sizeof(IconPanel));
memset(panel, 0, sizeof(IconPanel));
@@ -785,7 +784,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
/* check if the file the user selected is not the one that
* would be loaded by default with the current search path */
*file = WMGetListSelectedItem(panel->iconList)->text;
if (**file==0) {
if ((*file)[0]==0) {
wfree(*file);
*file = NULL;
} else {
@@ -804,8 +803,6 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
*file = NULL;
}
result = panel->result;
WMReleaseFont(panel->normalfont);
WMUnmapWidget(panel->win);
@@ -818,7 +815,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
XDestroyWindow(dpy, parent);
return result;
return panel->result;
}
@@ -865,10 +862,6 @@ typedef struct {
"Copyright \xa9 1997-2003 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
"Copyright \xa9 1998-2003 Dan Pascu <dan@windowmaker.org>"
#define COPYRIGHT_TEXT_UTF8 \
"Copyright \xc2\xa9 1997-2003 Alfredo K. Kojima <kojima@windowmaker.org>\n"\
"Copyright \xc2\xa9 1998-2003 Dan Pascu <dan@windowmaker.org>"
static InfoPanel *thePanel = NULL;
@@ -1317,7 +1310,7 @@ wShowInfoPanel(WScreen *scr)
WMResizeWidget(panel->copyrL, 360, 40);
WMMoveWidget(panel->copyrL, 15, 185);
WMSetLabelTextAlignment(panel->copyrL, WALeft);
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT_UTF8);
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT);
/* we want the (c) character in the font, so don't use a FontSet here */
// fix this -Dan font = WMCreateFontWithFlags(scr->wmscreen, "SystemFont-11", WFNormalFont);
font = WMSystemFontOfSize(scr->wmscreen, 11);

View File

@@ -478,7 +478,7 @@ handleMapRequest(XEvent *ev)
Window window = ev->xmaprequest.window;
#ifdef DEBUG
printf("got map request for %x\n", (unsigned)window);
L("got map request for %x\n", (unsigned)window);
#endif
if ((wwin = wWindowFor(window))) {
if (wwin->flags.shaded) {
@@ -553,7 +553,7 @@ handleDestroyNotify(XEvent *event)
int index;
#ifdef DEBUG
printf("got destroy notify\n");
L("got destroy notify");
#endif
wwin = wWindowFor(window);
if (wwin) {
@@ -607,7 +607,7 @@ handleExpose(XEvent *event)
XEvent ev;
#ifdef DEBUG
printf("got expose\n");
L("got expose");
#endif
while (XCheckTypedWindowEvent(dpy, event->xexpose.window, Expose, &ev));
@@ -662,7 +662,7 @@ handleButtonPress(XEvent *event)
WScreen *scr;
#ifdef DEBUG
printf("got button press\n");
L("got button press");
#endif
scr = wScreenForRootWindow(event->xbutton.root);
@@ -749,7 +749,7 @@ handleMapNotify(XEvent *event)
{
WWindow *wwin;
#ifdef DEBUG
printf("got map\n");
L("got map");
#endif
wwin = wWindowFor(event->xmap.event);
if (wwin && wwin->client_win == event->xmap.event) {
@@ -772,7 +772,7 @@ handleUnmapNotify(XEvent *event)
XEvent ev;
Bool withdraw = False;
#ifdef DEBUG
printf("got unmap\n");
L("got unmap");
#endif
/* only process windows with StructureNotify selected
* (ignore SubstructureNotify) */
@@ -824,7 +824,7 @@ handleConfigureRequest(XEvent *event)
{
WWindow *wwin;
#ifdef DEBUG
printf("got configure request\n");
L("got configure request");
#endif
if (!(wwin=wWindowFor(event->xconfigurerequest.window))) {
/*
@@ -847,7 +847,7 @@ handlePropertyNotify(XEvent *event)
unsigned int ju;
WScreen *scr;
#ifdef DEBUG
printf("got property notify\n");
L("got property notify");
#endif
if ((wwin=wWindowFor(event->xproperty.window))) {
if (!XGetGeometry(dpy, wwin->client_win, &jr, &ji, &ji,
@@ -876,7 +876,7 @@ handleClientMessage(XEvent *event)
WWindow *wwin;
WObjDescriptor *desc;
#ifdef DEBUG
printf("got client message\n");
L("got client message");
#endif
/* handle transition from Normal to Iconic state */
if (event->xclient.message_type == _XA_WM_CHANGE_STATE
@@ -1038,7 +1038,7 @@ handleEnterNotify(XEvent *event)
XEvent ev;
WScreen *scr = wScreenForRootWindow(event->xcrossing.root);
#ifdef DEBUG
printf("got enter notify\n");
L("got enter notify");
#endif
#ifdef VIRTUAL_DESKTOP
@@ -1178,7 +1178,7 @@ handleShapeNotify(XEvent *event)
WWindow *wwin;
XEvent ev;
#ifdef DEBUG
printf("got shape notify\n");
L("got shape notify");
#endif
while (XCheckTypedWindowEvent(dpy, shev->window, event->type, &ev)) {
XShapeEvent *sev = (XShapeEvent*)&ev;
@@ -1739,7 +1739,7 @@ handleMotionNotify(XEvent *event)
p.y >= (rect.pos.y + rect.size.height - 2)) {
WMenu *menu;
#ifdef DEBUG
printf("pointer at screen edge\n");
L("pointer at screen edge");
#endif
menu = wMenuUnderPointer(scr);
if (menu!=NULL)

View File

@@ -717,25 +717,22 @@ main(int argc, char **argv)
}
if (Locale) {
/* return of wstrconcat should not be free-ed! read putenv man page */
putenv(wstrconcat("LANG=", Locale));
} else {
Locale = getenv("LC_ALL");
if (!Locale) {
Locale = getenv("LANG");
}
if (!Locale) {
Locale = getenv("LC_ALL");
}
if (!Locale) {
Locale = getenv("LANG");
}
setlocale(LC_ALL, "");
if (!Locale || strcmp(Locale, "C")==0 || strcmp(Locale, "POSIX")==0)
Locale = NULL;
Locale = NULL;
#ifdef I18N
if (getenv("NLSPATH"))
bindtextdomain("WindowMaker", getenv("NLSPATH"));
bindtextdomain("WindowMaker", getenv("NLSPATH"));
else
bindtextdomain("WindowMaker", LOCALEDIR);
bindtextdomain("WindowMaker", LOCALEDIR);
textdomain("WindowMaker");
if (!XSupportsLocale()) {

View File

@@ -349,7 +349,7 @@ smartPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned int width, unsigned int height,
WArea usableArea)
{
//WScreen *scr = wwin->screen_ptr;
WScreen *scr = wwin->screen_ptr;
int test_x = 0, test_y = Y_ORIGIN(scr);
int from_x, to_x, from_y, to_y;
int sx;

View File

@@ -28,7 +28,6 @@
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "WindowMaker.h"
@@ -43,14 +42,14 @@
#endif
#ifdef DEBUG
#if 0
# define ENTER(X) fprintf(stderr,"Entering: %s()\n", X);
# define LEAVE(X) fprintf(stderr,"Leaving: %s()\n", X);
# define PDEBUG(X) fprintf(stderr,"debug: %s()\n", X);
# define DEBUG(X) fprintf(stderr,"debug: %s()\n", X);
#else
# define ENTER(X)
# define LEAVE(X)
# define PDEBUG(X)
# define DEBUG(X)
#endif
extern Cursor wCursor[WCUR_LAST];
@@ -583,32 +582,32 @@ textEventHandler( WObjDescriptor *desc, XEvent *event )
* text so we can wTextRefresh() */
if( event->xmotion.state & (Button1Mask|Button3Mask|Button2Mask) )
{
PDEBUG("MotionNotify");
DEBUG("MotionNotify");
handled = True;
wtext->text.endPos = textXtoPos( wtext, event->xmotion.x );
}
break;
case ButtonPress:
PDEBUG("ButtonPress");
DEBUG("ButtonPress");
handled = True;
wtext->text.startPos = textXtoPos( wtext, event->xbutton.x );
wtext->text.endPos = wtext->text.startPos;
break;
case ButtonRelease:
PDEBUG("ButtonRelease");
DEBUG("ButtonRelease");
handled = True;
wtext->text.endPos = textXtoPos( wtext, event->xbutton.x );
break;
case KeyPress:
PDEBUG("KeyPress");
DEBUG("KeyPress");
handled = handleKeyPress( wtext, &event->xkey );
break;
case EnterNotify:
PDEBUG("EnterNotify");
DEBUG("EnterNotify");
handled = True;
#if 0
if (!wtext->magic)
@@ -622,7 +621,7 @@ textEventHandler( WObjDescriptor *desc, XEvent *event )
break;
case LeaveNotify:
PDEBUG("LeaveNotify");
DEBUG("LeaveNotify");
handled = True;
#if 0
wtext->blinking = 0;

View File

@@ -86,7 +86,7 @@ void wXDNDMakeAwareness(Window window) {
}
void wXDNDClearAwareness(Window window) {
//long int xdnd_version = 3;
long int xdnd_version = 3;
XDeleteProperty (dpy, window, _XA_XdndAware);
}

View File

@@ -24,7 +24,6 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <string.h>
#include "wconfig.h"