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

another test for cvs notifications

This commit is contained in:
dan
2004-07-16 18:18:36 +00:00
parent 9b7b9f6815
commit 109bb540ec
42 changed files with 2054 additions and 1669 deletions

View File

@@ -104,7 +104,9 @@ wmaker_SOURCES = \
text.h
AM_CPPFLAGS = @CPPFLAGS@ $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
AM_CPPFLAGS = $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\"
AM_CFLAGS = -fno-strict-aliasing
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[0]==0) {
if (file && *file==0) {
wfree(file);
file = NULL;
}

View File

@@ -198,7 +198,9 @@ 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);
}
@@ -223,11 +225,6 @@ 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)) {
@@ -236,8 +233,9 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
openedSwitchMenu = True;
}
#endif
while (!done) {
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
while (hasModifier && !done) {
WMMaskEvent(dpy, KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
if (ev.type != KeyRelease && ev.type != KeyPress) {
WMHandleEvent(&ev);
@@ -247,7 +245,10 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
modifiers = ev.xkey.state & ValidModMask;
if (ev.type == KeyPress) {
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
#ifdef DEBUG
printf("Got key press\n");
#endif
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
newFocused = nextToFocusAfter(newFocused);
@@ -274,12 +275,18 @@ 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
@@ -294,6 +301,9 @@ 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,6 +636,7 @@ 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));
@@ -784,7 +785,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]==0) {
if (**file==0) {
wfree(*file);
*file = NULL;
} else {
@@ -803,6 +804,8 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
*file = NULL;
}
result = panel->result;
WMReleaseFont(panel->normalfont);
WMUnmapWidget(panel->win);
@@ -815,7 +818,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
XDestroyWindow(dpy, parent);
return panel->result;
return result;
}
@@ -862,6 +865,10 @@ 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;
@@ -1310,7 +1317,7 @@ wShowInfoPanel(WScreen *scr)
WMResizeWidget(panel->copyrL, 360, 40);
WMMoveWidget(panel->copyrL, 15, 185);
WMSetLabelTextAlignment(panel->copyrL, WALeft);
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT);
WMSetLabelText(panel->copyrL, COPYRIGHT_TEXT_UTF8);
/* 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
L("got map request for %x\n", (unsigned)window);
printf("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
L("got destroy notify");
printf("got destroy notify\n");
#endif
wwin = wWindowFor(window);
if (wwin) {
@@ -607,7 +607,7 @@ handleExpose(XEvent *event)
XEvent ev;
#ifdef DEBUG
L("got expose");
printf("got expose\n");
#endif
while (XCheckTypedWindowEvent(dpy, event->xexpose.window, Expose, &ev));
@@ -662,7 +662,7 @@ handleButtonPress(XEvent *event)
WScreen *scr;
#ifdef DEBUG
L("got button press");
printf("got button press\n");
#endif
scr = wScreenForRootWindow(event->xbutton.root);
@@ -749,7 +749,7 @@ handleMapNotify(XEvent *event)
{
WWindow *wwin;
#ifdef DEBUG
L("got map");
printf("got map\n");
#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
L("got unmap");
printf("got unmap\n");
#endif
/* only process windows with StructureNotify selected
* (ignore SubstructureNotify) */
@@ -824,7 +824,7 @@ handleConfigureRequest(XEvent *event)
{
WWindow *wwin;
#ifdef DEBUG
L("got configure request");
printf("got configure request\n");
#endif
if (!(wwin=wWindowFor(event->xconfigurerequest.window))) {
/*
@@ -847,7 +847,7 @@ handlePropertyNotify(XEvent *event)
unsigned int ju;
WScreen *scr;
#ifdef DEBUG
L("got property notify");
printf("got property notify\n");
#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
L("got client message");
printf("got client message\n");
#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
L("got enter notify");
printf("got enter notify\n");
#endif
#ifdef VIRTUAL_DESKTOP
@@ -1178,7 +1178,7 @@ handleShapeNotify(XEvent *event)
WWindow *wwin;
XEvent ev;
#ifdef DEBUG
L("got shape notify");
printf("got shape notify\n");
#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
L("pointer at screen edge");
printf("pointer at screen edge\n");
#endif
menu = wMenuUnderPointer(scr);
if (menu!=NULL)

View File

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