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

fixed crash bug with WM_CLASS==NULL

etc
This commit is contained in:
kojima
2001-08-20 18:11:40 +00:00
parent 0e2ac9dd16
commit fa994f627e
17 changed files with 188 additions and 12 deletions

View File

@@ -1,5 +1,10 @@
Changes since version 0.65.1:
.............................
- fixed crash when saving empty menu item in WPrefs
- Fixed some more bash specific constructs in wsetfont.
(Marcelo E. Magallon <marcelo.magallon@bigfoot.com>)
- fixed crash with broken apps that set null WM_CLASS
Changes since version 0.65.0:
.............................
@@ -26,6 +31,7 @@ Changes since version 0.65.0:
Robert Marshall <robert@chezmarshall.freeserve.co.uk>)
- Replaced almost all sprintf() calls with snprintf()
- fixed crash when removing menu entry for Window List or Workspace submenu
- added WINDOW_BIRTH_ZOOM2 (Éric Tremblay <delt@razorback.yi.org>)
Changes since version 0.64.0:
.............................

View File

@@ -37,6 +37,7 @@ SUPPORTED PLATFORMS
- PowerMac / Power MachTen 4.1.1 over MacOS
- Amiga 3000 running RedHat Linux 5.1 (Rawhide)
- IBM S/390 running Linux
- IBM S/390 running Conectiva Linux (experimental)
- iBook running Darwin
- Windows NT with Cygwin/XFree86
- Sony PlayStation2 running Linux

View File

@@ -944,7 +944,7 @@ static void setRowSelected(WMTableView *table, unsigned row, Bool flag)
}
}
if (repaint && row < table->rows) {
//drawFullRow(table, row);
/*drawFullRow(table, row);*/
repaintTable(table);
}
}

View File

@@ -57,6 +57,7 @@ libWINGs_a_SOURCES = \
wfont.c \
wfontpanel.c \
widgets.c \
winputmethod.c \
wlabel.c \
wlist.c \
wmenuitem.c \

View File

@@ -132,6 +132,8 @@ typedef struct W_Screen {
RContext *rcontext;
struct W_IMContext *imctx;
/* application related */
W_FocusInfo *focusInfo;

View File

@@ -617,6 +617,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->rootWin = RootWindow(display, screen);
scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks);
/* create input method stuff */
W_InitIMStuff(scrPtr);
/* Create missing CUT_BUFFERs */
{

View File

@@ -1259,7 +1259,7 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
normal_key:
default:
if (!controled) {
if (count > 0 && isprint(buffer[0])) {
if (count > 0 && !iscntrl(buffer[0])) {
if (tPtr->selection.count)
WMDeleteTextFieldRange(tPtr, tPtr->selection);
WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);

View File

@@ -1,4 +1,4 @@
EXTRA_DIST = README single_click.diff WindowMaker.spec.in
EXTRA_DIST = README single_click.diff WindowMaker.spec.in workspace_flip.patch

View File

@@ -3,7 +3,7 @@ This directory contains some patches contributed by ppl. Do NOT mail the
wmaker developers for any problems with them.
single_click.diff
*** single_click.diff
allows single click in dock
@@ -16,3 +16,12 @@ John Morrissey <jwm@horde.net>
updated for Window Maker 0.65.0 by:
Daniel Richard G. <skunk@graphics.lcs.mit.edu>
*** workspace_flip.patch
Allows flipping across workspaces by putting the
mouse in the side of the workspace.
author:
Martin Sarfy <xsarfy@informatics.muni.cz>

View File

@@ -0,0 +1,126 @@
diff -Naur WindowMaker-0.65.0/src/WindowMaker.h wmaker-workspaceflip/src/WindowMaker.h
--- WindowMaker-0.65.0/src/WindowMaker.h Sat Apr 28 01:41:21 2001
+++ wmaker-workspaceflip/src/WindowMaker.h Sun Aug 12 12:51:14 2001
@@ -397,6 +397,8 @@
int raise_delay; /* delay for autoraise. 0 is disabled */
+ int workspace_flip_delay; /* delay for workspace flipping, 0 is disabled */
+
int cmap_size; /* size of dithering colormap in colors
* per channel */
diff -Naur WindowMaker-0.65.0/src/defaults.c wmaker-workspaceflip/src/defaults.c
--- WindowMaker-0.65.0/src/defaults.c Fri May 11 00:16:49 2001
+++ wmaker-workspaceflip/src/defaults.c Sun Aug 12 12:51:14 2001
@@ -420,6 +420,9 @@
{"RaiseDelay", "0", NULL,
&wPreferences.raise_delay, getInt, NULL
},
+ {"WorkspaceFlipDelay", "0", NULL,
+ &wPreferences.workspace_flip_delay, getInt, NULL
+ },
{"WindozeCycling", "YES", NULL,
&wPreferences.windows_cycling,getBool, NULL
},
diff -Naur WindowMaker-0.65.0/src/event.c wmaker-workspaceflip/src/event.c
--- WindowMaker-0.65.0/src/event.c Sat Apr 28 01:41:21 2001
+++ wmaker-workspaceflip/src/event.c Sun Aug 12 12:51:14 2001
@@ -1676,12 +1676,53 @@
}
}
+#define DEL_TIMER(timer) { \
+ WMDeleteTimerHandler(timer); \
+ timer = NULL; \
+}
+
+
+
+static void
+flipRightWorkspace(void* data)
+{
+ WScreen *scr = (WScreen*)data;
+ int x,y,tmp,last_workspace = scr->current_workspace;
+ Window tmpw;
+
+ DEL_TIMER(scr->workspace_flip_right_timer);
+
+ XQueryPointer(dpy,scr->root_win,&tmpw,&tmpw,&x,&y,&tmp,&tmp,&tmp);
+ if(x != scr->scr_width-1) return;
+
+ wWorkspaceRelativeChange(scr, 1);
+ if(last_workspace != scr->current_workspace)
+ XWarpPointer(dpy,None,scr->root_win,0,0,0,0,1,y);
+}
+
+static void
+flipLeftWorkspace(void* data)
+{
+ WScreen *scr = (WScreen*)data;
+ int x,y,tmp,last_workspace = scr->current_workspace;
+ Window tmpw;
+
+ DEL_TIMER(scr->workspace_flip_left_timer);
+
+ XQueryPointer(dpy,scr->root_win,&tmpw,&tmpw,&x,&y,&tmp,&tmp,&tmp);
+ if(x != 0) return;
+
+ wWorkspaceRelativeChange(scr, -1);
+ if(last_workspace != scr->current_workspace)
+ XWarpPointer(dpy,None,scr->root_win,0,0,0,0,scr->scr_width-2,y);
+}
static void
handleMotionNotify(XEvent *event)
{
WMenu *menu;
WScreen *scr = wScreenForRootWindow(event->xmotion.root);
+ int left,right;
if (wPreferences.scrollable_menus) {
if (scr->flags.jump_back_pending ||
@@ -1697,6 +1738,29 @@
wMenuScroll(menu, event);
}
}
+
+ /* workspace flipping */
+ if(!wPreferences.workspace_flip_delay) return;
+
+ left = (event->xmotion.x_root == 0);
+ right = (event->xmotion.x_root == scr->scr_width-1);
+
+ if(right && !scr->workspace_flip_right_timer)
+ scr->workspace_flip_right_timer =
+ WMAddTimerHandler(wPreferences.workspace_flip_delay,
+ flipRightWorkspace,scr);
+
+ if(left && !scr->workspace_flip_left_timer)
+ scr->workspace_flip_left_timer =
+ WMAddTimerHandler(wPreferences.workspace_flip_delay,
+ flipLeftWorkspace,scr);
+
+ if(!right && scr->workspace_flip_right_timer)
+ DEL_TIMER(scr->workspace_flip_right_timer);
+
+ if(!left && scr->workspace_flip_left_timer)
+ DEL_TIMER(scr->workspace_flip_left_timer);
+
#if 0
if (event->xmotion.subwindow == None)
return;
diff -Naur WindowMaker-0.65.0/src/screen.h wmaker-workspaceflip/src/screen.h
--- WindowMaker-0.65.0/src/screen.h Sun Apr 15 03:23:01 2001
+++ wmaker-workspaceflip/src/screen.h Sun Aug 12 12:51:14 2001
@@ -273,6 +273,10 @@
Window last_click_window;
int last_click_button;
+ /* for workspace flipping when mouse hits edge */
+ WMHandlerID *workspace_flip_left_timer;
+ WMHandlerID *workspace_flip_right_timer;
+
/* balloon help data */
struct _WBalloon *balloon;

View File

@@ -1714,3 +1714,4 @@ msgstr "Tuhoa viimeinen"
#: ../src/xutil.c:228
msgid "invalid data in selection"
msgstr "virheellistä tietoa valinnassa"

View File

@@ -740,7 +740,7 @@ animateResizeZoom(WScreen *scr, int x, int y, int w, int h,
#undef FRAMES
static void
void
animateResize(WScreen *scr, int x, int y, int w, int h,
int fx, int fy, int fw, int fh, int hiding)
{

View File

@@ -413,7 +413,6 @@ wApplicationCreate(WScreen *scr, Window main_window)
if (!tmp)
extractClientIcon(wapp->app_icon);
}
/* set the application instance index */
{
WApplication *list = scr->wapp_list;
@@ -424,14 +423,16 @@ wApplicationCreate(WScreen *scr, Window main_window)
if (!WFLAGP(wwin, collapse_appicons))
return 0;
*/
#define Xstreql(a, b) ((a) == (b) || (a && b && strcmp(a, b)==0))
/* look for a free index # */
while (list) {
if (strcmp(wwin->wm_instance,
list->main_window_desc->wm_instance) == 0
if (Xstreql(wwin->wm_instance,
list->main_window_desc->wm_instance)
&&
strcmp(wwin->wm_class,
list->main_window_desc->wm_class) == 0) {
Xstreql(wwin->wm_class,
list->main_window_desc->wm_class)) {
if (list->index == index) {
index++;

View File

@@ -336,7 +336,7 @@ getLocalizedMenuFile(char *menu)
if (!Locale)
return NULL;
len = strlen(menu)+32;
len = strlen(menu)+strlen(Locale)+8;
buffer = wmalloc(len);
/* try menu.locale_name */

View File

@@ -446,12 +446,35 @@ DoWindowBirth(WWindow *wwin)
XFlush(dpy);
}
#else
#ifdef WINDOW_BIRTH_ZOOM2
extern void animateResize();
void DoWindowBirth(WWindow *wwin)
{
/* dummy stub */
int center_x, center_y;
int width = wwin->frame->core->width;
int height = wwin->frame->core->height;
int w = WMIN(width, 20);
int h = WMIN(height, 20);
WScreen *scr = wwin->screen_ptr;
center_x = wwin->frame_x + (width - w) / 2;
center_y = wwin->frame_y + (height - h) / 2;
animateResize(scr, center_x, center_y, 1, 1,
wwin->frame_x , wwin->frame_y, width, height,
0);
}
#else
void
DoWindowBirth(WWindow *wwin)
{
/* dummy stub */
}
#endif
#endif

View File

@@ -181,7 +181,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
WMenu *switchmenu = scr->switch_menu;
WMenuEntry *entry;
char title[MAX_MENU_TEXT_LENGTH+6];
int len = MAX_MENU_TEXT_LENGTH+6;
int len = sizeof(title);
int i;
int checkVisibility = 0;

View File

@@ -206,6 +206,8 @@
*/
#undef WINDOW_BIRTH_ZOOM
#define WINDOW_BIRTH_ZOOM2
/*
* whether arrow drawing in clip buttons should be gradiented
*/