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

- Fixed focus handling for windows that set WM_HINTS.take_focus = False.

- Misc fixes.
- Improved a bit the python wrapper.
- Build po files before 'make install'
This commit is contained in:
dan
2002-12-20 17:47:31 +00:00
parent 55d37178a0
commit 064f79ebae
17 changed files with 225 additions and 203 deletions

View File

@@ -39,6 +39,7 @@ Changes since version 0.80.1:
- Added a check that only %d is used in a font specification in WMGLOBAL and at
most once for each font in a fontset (eliminates a possible security exploit)
- Added fontpanel callback
- Fixed focus handling for windows that set WM_HINTS.take_focus = False.
Changes since version 0.80.0:

View File

@@ -51,6 +51,7 @@ Changes since wmaker 0.80.1:
only a reference to the internal color, which you shouldn't release
- Added wstrndup()
- Added WMGetFontName()
- Added fontpanel callback
Changes since wmaker 0.80.0:

View File

@@ -4,7 +4,7 @@ CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) WINGs.pot
EXTRA_DIST = cs.po de.po sk.po fr.po
EXTRA_DIST = cs.po de.po fr.po sk.po
POTFILES = \
$(top_builddir)/WINGs/connection.c \
@@ -27,6 +27,8 @@ SUFFIXES = .po .mo
msgfmt -o $@ $<
all-local: $(CATALOGS)
WINGs.pot: $(POTFILES)
xgettext --default-domain=WINGs \
--add-comments --keyword=_ $(POTFILES)

View File

@@ -1,7 +1,7 @@
all: WINGs.c
python setup.py build
ln -s `find build/ -name wings.so` .
ln -sf `find build/ -name wings.so` .
install: WINGs.c
python setup.py install

View File

@@ -28,7 +28,7 @@
return NULL;
}
}
// This cleans up the char ** array we mallocd before the function call
// This cleans up the char ** array we malloc-ed before the function call
%typemap(python, freearg) char ** {
wfree($1);
}
@@ -95,7 +95,7 @@
$1 = PyFile_AsFile($input);
}
/* These are for freeing the return of functions that need to be freed
/* These are for free-ing the return of functions that need to be freed
* before returning control to python. */
%typemap(python, ret) char* WMGetTextFieldText { wfree($1); };
@@ -173,6 +173,7 @@
//%rename WMScreenMainLoop _WMScreenMainLoop;
//%rename(_WMScreenMainLoop) WMScreenMainLoop;
//%rename WMRunModalLoop _WMRunModalLoop;
@@ -529,14 +530,34 @@
%}
/* ignore structures we will not use */
%ignore ConnectionDelegate;
/* ignore functions we don't need */
// should we ignore vararg functions, or just convert them to functions with
// a fixed number of parameters?
%varargs(char*) wmessage;
//%ignore wmessage;
%ignore wwarning;
%ignore wfatal;
%ignore wsyserror;
%ignore wsyserrorwithcode;
%ignore WMCreatePLArray;
%ignore WMCreatePLDictionary;
%apply int *INPUT { int *argc };
#define Bool int
%include "WINGs/WUtil.h"
/* ignore structures we will not use */
/* ignore functions we don't need */
%include "WINGs/WINGs.h"
%{
void
WHandleEvents()
@@ -558,6 +579,7 @@ WHandleEvents()
}
%}
/* rewrite functions originally defined as macros */
%inline %{
#undef WMDuplicateArray

View File

@@ -2,23 +2,27 @@
import sys
import wings
import exceptions
from exceptions import Exception, StandardError
from types import *
# Some useful constants
False = 0
True = 1
# check about None as action for buttonAction/windowCloseAction ...
################################################################################
# Exceptions
################################################################################
class Error(exceptions.Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
__repr__ = __str__
class Error(StandardError):
pass
del Exception, StandardError
class WMTimer:
def __init__(self, milliseconds, callback, cdata=None, persistent=0):
def __init__(self, milliseconds, callback, cdata=None, persistent=False):
if persistent:
self._o = wings.pyWMAddPersistentTimerHandler(milliseconds, (callback, cdata))
else:
@@ -30,15 +34,17 @@ class WMTimer:
class WMPersistentTimer(WMTimer):
def __init__(self, milliseconds, callback, cdata=None):
WMTimer.__init__(self, milliseconds, callback, cdata, persistent=1)
WMTimer.__init__(self, milliseconds, callback, cdata, persistent=True)
class WMScreen:
__readonly = ('display', 'width', 'height', 'depth')
def __init__(self, appname, display="", simpleapp=0):
def __init__(self, appname, display="", simpleapp=False):
wings.WMInitializeApplication(appname, len(sys.argv), sys.argv)
self._o = wings.pyWMOpenScreen(display, simpleapp)
if not self._o:
raise Error, "Cannot open display %s" % display
self.__dict__['display'] = wings.WMScreenDisplay(self._o)
self.__dict__['width'] = wings.WMScreenWidth(self._o)
self.__dict__['height'] = wings.WMScreenHeight(self._o)
@@ -429,7 +435,7 @@ class WMTextField(WMWidget):
wings.WMSetTextFieldFont(self._o, font)
def font(self):
return wings.WMGettextFieldFont(self._o)
return wings.WMGetTextFieldFont(self._o)
################################################################################
@@ -509,7 +515,7 @@ if __name__ == "__main__":
win2.hide()
def dc(object, data, action):
print "didChnage:", object, data, action
print "didChange:", object, data, action
def dbe(object, data, action):
print "didBeginEditing:", object, data, action
@@ -520,7 +526,7 @@ if __name__ == "__main__":
object.setFocusTo(txt2)
else:
object.setFocusTo(txt)
print "didEndEditing:", object, data, action, txt.text()
print "didEndEditing:", object, data, action, object.text()
def tcb(one):
old = list.selectedItemRow()

View File

@@ -11,6 +11,7 @@ wings = os.popen("get-wings-flags --cflags", "r")
lines = [x.strip() for x in wings.readlines()]
flags = reduce(lambda x,y: x+y, [x.split() for x in lines if x])
include_dirs = [x[2:] for x in flags]
#include_dirs += [".."]
wings.close()
## Get the library dirs
@@ -18,6 +19,7 @@ wings = os.popen("get-wings-flags --ldflags", "r")
lines = [x.strip() for x in wings.readlines()]
flags = reduce(lambda x,y: x+y, [x.split() for x in lines if x])
library_dirs = [x[2:] for x in flags]
#library_dirs += [".."]
wings.close()
## Get the libraries

View File

@@ -24,7 +24,7 @@ if __name__ == "__main__":
win2.hide()
def dc(object, data, action):
print "didChnage:", object, data, action
print "didChange:", object, data, action
def dbe(object, data, action):
print "didBeginEditing:", object, data, action
@@ -35,7 +35,7 @@ if __name__ == "__main__":
object.setFocusTo(txt2)
else:
object.setFocusTo(txt)
print "didEndEditing:", object, data, action, txt.text()
print "didEndEditing:", object, data, action, object.text()
def tcb(one):
old = list.selectedItemRow()

View File

@@ -193,13 +193,13 @@ WMCreateColorWell(WMWidget *parent)
WMAddNotificationObserver(colorChangedObserver, cPtr,
WMColorPanelColorChangedNotification, NULL);
WMSetViewDragSourceProcs(cPtr->view, &_DragSourceProcs);
WMSetViewDragDestinationProcs(cPtr->view, &_DragDestinationProcs);
WMSetViewDragSourceProcs(cPtr->colorView, &_DragSourceProcs);
WMSetViewDragDestinationProcs(cPtr->colorView, &_DragDestinationProcs);
{
char *types[2] = {"application/X-color", NULL};
WMRegisterViewForDraggedTypes(cPtr->view, types);
WMRegisterViewForDraggedTypes(cPtr->colorView, types);
}
return cPtr;
@@ -370,12 +370,11 @@ handleDragEvents(XEvent *event, void *data)
offs.height = 2;
pixmap = makeDragPixmap(cPtr);
WMDragImageFromView(cPtr->view, pixmap, types,
WMDragImageFromView(cPtr->colorView, pixmap, types,
wmkpoint(event->xmotion.x_root,
event->xmotion.y_root),
offs, event, True);
WMReleasePixmap(pixmap);
}
}

View File

@@ -62,36 +62,31 @@ static WMEventHook *extraEventHandler=NULL;
* WMCreateEventHandler--
* Create an event handler and put it in the event handler list for the
* view. If the same callback and clientdata are already used in another
* handler, the masks are swapped.
* handler, the masks are OR'ed.
*
*/
void
WMCreateEventHandler(WMView *view, unsigned long mask, WMEventProc *eventProc,
void *clientData)
{
W_EventHandler *handler, *ptr;
unsigned long eventMask;
W_EventHandler *hPtr;
WMArrayIterator iter;
handler = NULL;
eventMask = mask;
WM_ITERATE_ARRAY(view->eventHandlers, ptr, iter) {
if (ptr->clientData == clientData && ptr->proc == eventProc) {
handler = ptr;
eventMask |= ptr->eventMask;
WM_ITERATE_ARRAY(view->eventHandlers, hPtr, iter) {
if (hPtr->clientData==clientData && hPtr->proc==eventProc) {
hPtr->eventMask |= mask;
return;
}
}
if (!handler) {
handler = wmalloc(sizeof(W_EventHandler));
WMAddToArray(view->eventHandlers, handler);
}
hPtr = wmalloc(sizeof(W_EventHandler));
/* select events for window */
handler->eventMask = eventMask;
handler->proc = eventProc;
handler->clientData = clientData;
hPtr->eventMask = mask;
hPtr->proc = eventProc;
hPtr->clientData = clientData;
WMAddToArray(view->eventHandlers, hPtr);
}

View File

@@ -387,7 +387,7 @@ void
WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data)
{
panel->action = action;
panel->actionData = data;
panel->data = data;
}

View File

@@ -2,7 +2,7 @@ CATALOGS = @WPMOFILES@
nlsdir = $(NLSDIR)
CLEANFILES = $(CATALOGS)
CLEANFILES = WPrefs.pot $(CATALOGS)
EXTRA_DIST = pt.po hr.po fr.po ko.po cs.po ja.po zh_TW.Big5.po es.po\
zh_CN.po fi.po it.po ru.po de.po hu.po bg.po sk.po\
@@ -36,6 +36,8 @@ SUFFIXES = .po .mo
msgfmt -o $@ $<
all-local: $(CATALOGS)
WPrefs.pot: $(POTFILES)
xgettext --default-domain=WPrefs \
--add-comments --keyword=_ $(POTFILES)

View File

@@ -288,7 +288,7 @@ dnl List of supported locales
dnl -------------------------
supported_locales="be bg cs da de el es et fi fr gl hr hu it ja ko ms nl no pl pt ro ru sk sv tr zh_CN zh_TW.Big5"
supported_wprefs_locales="bg cs de es et fi fr hr hu it ja ko pt ru sk zh_CN zh_TW.Big5"
supported_wings_locales="cs de sk"
supported_wings_locales="cs de fr sk"
for lang in $LINGUAS; do
ok=0

View File

@@ -7,7 +7,7 @@ wmaker developers for any problems with them.
allows single click in dock
for version: 0.65.0
for version: 0.80.2
author:
Sebastien Bauer <seb_bauer@bigfoot.com>
@@ -16,6 +16,8 @@ John Morrissey <jwm@horde.net>
updated for Window Maker 0.65.0 by:
Daniel Richard G. <skunk@graphics.lcs.mit.edu>
updated for Window Maker 0.80.2 by:
Martial Daumas <martial@nasgaia.org>
*** workspace_flip.patch

View File

@@ -1,15 +1,140 @@
diff -ur WindowMaker-0.65.1/WPrefs.app/Expert.c WindowMaker-0.65.1-patched/WPrefs.app/Expert.c
--- WindowMaker-0.65.1/WPrefs.app/Expert.c Mon Jun 4 13:47:32 2001
+++ WindowMaker-0.65.1-patched/WPrefs.app/Expert.c Sat Aug 18 03:53:25 2001
@@ -33,7 +33,7 @@
diff -urN WindowMaker-0.80.2/src/appicon.c WindowMaker-0.80.2.modif/src/appicon.c
--- WindowMaker-0.80.2/src/appicon.c 2002-01-08 14:45:07.000000000 +0100
+++ WindowMaker-0.80.2.modif/src/appicon.c 2002-12-09 08:59:22.000000000 +0100
@@ -596,6 +596,7 @@
int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
int ix, iy;
int clickButton = event->xbutton.button;
+ Bool hasMoved = False;
Pixmap ghost = None;
Window wins[2];
Bool movingSingle = False;
@@ -676,6 +677,7 @@
break;
WMWidget *parent;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -812,7 +814,8 @@
- WMButton *swi[8];
+ WMButton *swi[9];
if (wPreferences.auto_arrange_icons)
wArrangeIcons(scr, True);
-
+ if (!hasMoved && wPreferences.single_click)
+ iconDblClick(desc, event);
done = 1;
break;
}
diff -urN WindowMaker-0.80.2/src/defaults.c WindowMaker-0.80.2.modif/src/defaults.c
--- WindowMaker-0.80.2/src/defaults.c 2002-01-08 14:45:07.000000000 +0100
+++ WindowMaker-0.80.2.modif/src/defaults.c 2002-12-09 09:00:01.000000000 +0100
@@ -548,6 +548,9 @@
{"DisableBlinking", "NO", NULL,
&wPreferences.dont_blink, getBool, NULL
},
+ {"SingleClickLaunch", "NO", NULL,
+ &wPreferences.single_click, getBool, NULL
+ },
/* style options */
{"MenuStyle", "normal", seMenuStyles,
&wPreferences.menu_style, getEnum, setMenuStyle
diff -urN WindowMaker-0.80.2/src/dock.c WindowMaker-0.80.2.modif/src/dock.c
--- WindowMaker-0.80.2/src/dock.c 2002-02-21 12:28:48.000000000 +0100
+++ WindowMaker-0.80.2.modif/src/dock.c 2002-12-09 09:02:58.000000000 +0100
@@ -3773,7 +3773,7 @@
} _Panel;
-static void
+static Bool
handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
{
WScreen *scr = dock->screen_ptr;
@@ -3789,6 +3789,7 @@
int tmp;
Pixmap ghost = None;
Bool docked;
+ Bool hasMoved = False;
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
int omnipresent = aicon->omnipresent; /* this must be cached!!! */
@@ -3843,6 +3844,7 @@
break;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -3992,7 +3994,7 @@
#ifdef DEBUG
puts("End icon move");
#endif
- return;
+ return hasMoved;
}
}
}
@@ -4131,8 +4133,11 @@
handleClipChangeWorkspace(scr, event);
else
handleDockMove(dock, aicon, event);
- } else
- handleIconMove(dock, aicon, event);
+ } else {
+ Bool hasMoved = handleIconMove(dock, aicon, event);
+ if (!hasMoved && wPreferences.single_click)
+ iconDblClick(desc, event);
+ }
} else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
aicon==scr->clip_icon) {
diff -urN WindowMaker-0.80.2/src/icon.c WindowMaker-0.80.2.modif/src/icon.c
--- WindowMaker-0.80.2/src/icon.c 2002-02-21 12:28:48.000000000 +0100
+++ WindowMaker-0.80.2.modif/src/icon.c 2002-12-09 09:04:53.000000000 +0100
@@ -879,6 +879,7 @@
int dx=event->xbutton.x, dy=event->xbutton.y;
int grabbed=0;
int clickButton=event->xbutton.button;
+ Bool hasMoved = False;
if (WCHECK_STATE(WSTATE_MODAL))
return;
@@ -930,6 +931,7 @@
break;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -967,6 +969,8 @@
if (wPreferences.auto_arrange_icons)
wArrangeIcons(wwin->screen_ptr, True);
+ if (!hasMoved && wPreferences.single_click)
+ miniwindowDblClick(desc, event);
return;
}
diff -urN WindowMaker-0.80.2/src/WindowMaker.h WindowMaker-0.80.2.modif/src/WindowMaker.h
--- WindowMaker-0.80.2/src/WindowMaker.h 2002-02-21 12:28:48.000000000 +0100
+++ WindowMaker-0.80.2.modif/src/WindowMaker.h 2002-12-09 08:57:47.000000000 +0100
@@ -464,6 +464,9 @@
/* shading animation */
signed char shade_speed;
+ /* single click to lauch applications */
+ char single_click;
+
int edge_resistance;
char attract;
diff -urN WindowMaker-0.80.2/WPrefs.app/Expert.c WindowMaker-0.80.2.modif/WPrefs.app/Expert.c
--- WindowMaker-0.80.2/WPrefs.app/Expert.c 2002-01-08 14:44:38.000000000 +0100
+++ WindowMaker-0.80.2.modif/WPrefs.app/Expert.c 2002-12-09 08:56:09.000000000 +0100
@@ -54,6 +54,7 @@
WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindozeCycling"));
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
@@ -42,138 +167,3 @@ diff -ur WindowMaker-0.65.1/WPrefs.app/Expert.c WindowMaker-0.65.1-patched/WPref
+ SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
}
diff -ur WindowMaker-0.65.1/src/WindowMaker.h WindowMaker-0.65.1-patched/src/WindowMaker.h
--- WindowMaker-0.65.1/src/WindowMaker.h Wed Jun 6 15:07:42 2001
+++ WindowMaker-0.65.1-patched/src/WindowMaker.h Sat Aug 18 03:47:36 2001
@@ -463,6 +463,9 @@
/* shading animation */
signed char shade_speed;
+ /* single click to lauch applications */
+ char single_click;
+
int edge_resistance;
char attract;
diff -ur WindowMaker-0.65.1/src/appicon.c WindowMaker-0.65.1-patched/src/appicon.c
--- WindowMaker-0.65.1/src/appicon.c Mon Jul 23 14:32:46 2001
+++ WindowMaker-0.65.1-patched/src/appicon.c Sat Aug 18 03:47:36 2001
@@ -704,6 +704,7 @@
int shad_x = 0, shad_y = 0, docking=0, dockable, collapsed = 0;
int ix, iy;
int clickButton = event->xbutton.button;
+ Bool hasMoved = False;
Pixmap ghost = None;
Window wins[2];
Bool movingSingle = False;
@@ -794,6 +795,7 @@
break;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -939,6 +941,8 @@
if (wPreferences.auto_arrange_icons)
wArrangeIcons(scr, True);
+ if (!hasMoved && wPreferences.single_click)
+ iconDblClick(desc, event);
done = 1;
break;
diff -ur WindowMaker-0.65.1/src/defaults.c WindowMaker-0.65.1-patched/src/defaults.c
--- WindowMaker-0.65.1/src/defaults.c Mon Jul 23 14:31:36 2001
+++ WindowMaker-0.65.1-patched/src/defaults.c Sat Aug 18 03:47:36 2001
@@ -557,6 +557,9 @@
{"DisableBlinking", "NO", NULL,
&wPreferences.dont_blink, getBool, NULL
},
+ {"SingleClickLaunch", "NO", NULL,
+ &wPreferences.single_click, getBool, NULL
+ },
/* style options */
{"MenuStyle", "normal", seMenuStyles,
&wPreferences.menu_style, getEnum, setMenuStyle
diff -ur WindowMaker-0.65.1/src/dock.c WindowMaker-0.65.1-patched/src/dock.c
--- WindowMaker-0.65.1/src/dock.c Mon Jul 23 14:37:25 2001
+++ WindowMaker-0.65.1-patched/src/dock.c Sat Aug 18 03:47:36 2001
@@ -3690,7 +3690,7 @@
-static void
+static Bool
handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
{
WScreen *scr = dock->screen_ptr;
@@ -3706,6 +3706,7 @@
int tmp;
Pixmap ghost = None;
Bool docked;
+ Bool hasMoved = False;
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
int omnipresent = aicon->omnipresent; /* this must be cached!!! */
@@ -3760,6 +3761,7 @@
break;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -3909,7 +3911,7 @@
#ifdef DEBUG
puts("End icon move");
#endif
- return;
+ return hasMoved;
}
}
}
@@ -4048,8 +4050,11 @@
handleClipChangeWorkspace(scr, event);
else
handleDockMove(dock, aicon, event);
- } else
- handleIconMove(dock, aicon, event);
+ } else {
+ Bool hasMoved = handleIconMove(dock, aicon, event);
+ if (!hasMoved && wPreferences.single_click)
+ iconDblClick(desc, event);
+ }
} else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
aicon==scr->clip_icon) {
diff -ur WindowMaker-0.65.1/src/icon.c WindowMaker-0.65.1-patched/src/icon.c
--- WindowMaker-0.65.1/src/icon.c Mon Jul 23 14:20:27 2001
+++ WindowMaker-0.65.1-patched/src/icon.c Sat Aug 18 03:47:36 2001
@@ -877,6 +877,7 @@
int dx=event->xbutton.x, dy=event->xbutton.y;
int grabbed=0;
int clickButton=event->xbutton.button;
+ Bool hasMoved = False;
if (WCHECK_STATE(WSTATE_MODAL))
return;
@@ -928,6 +929,7 @@
break;
case MotionNotify:
+ hasMoved = True;
if (!grabbed) {
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
@@ -965,6 +967,9 @@
if (wPreferences.auto_arrange_icons)
wArrangeIcons(wwin->screen_ptr, True);
+ if (!hasMoved && wPreferences.single_click)
+ miniwindowDblClick(desc, event);
+
return;
}

View File

@@ -46,6 +46,8 @@ SUFFIXES = .po .mo
msgfmt -o $@ $<
all-local: $(CATALOGS)
WindowMaker.pot: $(POTFILES)
xgettext --default-domain=WindowMaker \
--add-comments --keyword=_ $(POTFILES)

View File

@@ -495,9 +495,7 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace)
/* windows that have takefocus=False shouldn't take focus at all */
if (wwin->focus_mode == WFM_NO_INPUT) {
/* dont use WSETUFLAG, since this was not an attribute change
* made by the user */
wwin->user_flags.no_focusable = 1;
wwin->client_flags.no_focusable = 1;
}
}