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

fixed problem with motion event compression

This commit is contained in:
kojima
2000-07-16 01:08:13 +00:00
parent ee0fa6ec7d
commit ce7db48e25
2 changed files with 56 additions and 13 deletions

View File

@@ -96,6 +96,9 @@ typedef struct _Panel {
WMButton *sclearB; WMButton *sclearB;
WMList *icommandL; WMList *icommandL;
WMFrame *paramF;
WMTextField *paramT;
Bool dontAsk; /* whether to comfirm submenu remove */ Bool dontAsk; /* whether to comfirm submenu remove */
Bool dontSave; Bool dontSave;
@@ -216,6 +219,22 @@ stripClicked(WMWidget *w, void *data)
} }
static void
icommandLClicked(WMWidget *w, void *data)
{
_Panel *panel = (_Panel*)data;
switch (WMGetListSelectedItemRow(w)) {
case 6:
WMMapWidget(panel->paramF);
break;
default:
WMUnmapWidget(panel->paramF);
break;
}
}
static void static void
createPanel(_Panel *p) createPanel(_Panel *p)
{ {
@@ -223,7 +242,6 @@ createPanel(_Panel *p)
WMScreen *scr = WMWidgetScreen(panel->win); WMScreen *scr = WMWidgetScreen(panel->win);
WMColor *black = WMBlackColor(scr); WMColor *black = WMBlackColor(scr);
WMColor *white = WMWhiteColor(scr); WMColor *white = WMWhiteColor(scr);
WMColor *dark = WMDarkGrayColor(scr);
WMColor *gray = WMGrayColor(scr); WMColor *gray = WMGrayColor(scr);
WMFont *bold = WMBoldSystemFontOfSize(scr, 12); WMFont *bold = WMBoldSystemFontOfSize(scr, 12);
WMFont *font = WMSystemFontOfSize(scr, 12); WMFont *font = WMSystemFontOfSize(scr, 12);
@@ -510,18 +528,11 @@ createPanel(_Panel *p)
/* internal command */ /* internal command */
label = WMCreateLabel(panel->optionsF);
WMResizeWidget(label, width, 20);
WMMoveWidget(label, 10, 20);
WMSetWidgetBackgroundColor(label, dark);
WMSetLabelText(label, _("Commands"));
WMSetLabelTextColor(label, white);
WMSetLabelFont(label, bold);
WMSetLabelRelief(label, WRSunken);
panel->icommandL = WMCreateList(panel->optionsF); panel->icommandL = WMCreateList(panel->optionsF);
WMResizeWidget(panel->icommandL, width, 80); WMResizeWidget(panel->icommandL, width, 80);
WMMoveWidget(panel->icommandL, 10, 43); WMMoveWidget(panel->icommandL, 10, 20);
WMSetListAction(panel->icommandL, icommandLClicked, panel);
WMAddNotificationObserver(dataChanged, panel, WMAddNotificationObserver(dataChanged, panel,
WMListSelectionDidChangeNotification, WMListSelectionDidChangeNotification,
@@ -542,6 +553,17 @@ createPanel(_Panel *p)
WMInsertListItem(panel->icommandL, 10, _("Open Info Panel")); WMInsertListItem(panel->icommandL, 10, _("Open Info Panel"));
WMInsertListItem(panel->icommandL, 11, _("Open Copyright Panel")); WMInsertListItem(panel->icommandL, 11, _("Open Copyright Panel"));
panel->paramF = WMCreateFrame(panel->optionsF);
WMResizeWidget(panel->paramF, width, 50);
WMMoveWidget(panel->paramF, 10, 105);
WMSetFrameTitle(panel->paramF, _("Window Manager to Start"));
panel->paramT = WMCreateTextField(panel->paramF);
WMResizeWidget(panel->paramT, width - 20, 20);
WMMoveWidget(panel->paramT, 10, 20);
WMMapSubwidgets(panel->paramF);
WMRealizeWidget(panel->frame); WMRealizeWidget(panel->frame);
WMMapSubwidgets(panel->frame); WMMapSubwidgets(panel->frame);
@@ -549,7 +571,6 @@ createPanel(_Panel *p)
panel->sections[ExecInfo][0] = panel->commandF; panel->sections[ExecInfo][0] = panel->commandF;
panel->sections[ExecInfo][1] = panel->shortF; panel->sections[ExecInfo][1] = panel->shortF;
@@ -762,7 +783,7 @@ updateFrameTitle(_Panel *panel, char *title, InfoType type)
case ExecInfo: case ExecInfo:
tmp = wstrappend(title, _(": Execute Program")); tmp = wstrappend(title, _(": Execute Program"));
break; break;
case CommandInfo: case CommandInfo:
tmp = wstrappend(title, _(": Perform Internal Command")); tmp = wstrappend(title, _(": Perform Internal Command"));
break; break;
@@ -852,6 +873,13 @@ updateMenuItem(_Panel *panel, WEditMenuItem *item, WMWidget *changedWidget)
if (changedWidget == panel->icommandL) { if (changedWidget == panel->icommandL) {
data->param.command.command = data->param.command.command =
WMGetListSelectedItemRow(panel->icommandL); WMGetListSelectedItemRow(panel->icommandL);
switch (data->param.command.command) {
case 6:
data->param.command.parameter =
WMGetTextFieldText(panel->paramT);
break;
}
} }
if (changedWidget == panel->shortT) { if (changedWidget == panel->shortT) {
REPLACE(data->param.command.shortcut, REPLACE(data->param.command.shortcut,
@@ -1030,6 +1058,15 @@ menuItemSelected(WEditMenuDelegate *delegate, WEditMenu *menu,
WMSetListPosition(panel->icommandL, WMSetListPosition(panel->icommandL,
data->param.command.command - 2); data->param.command.command - 2);
WMSetTextFieldText(panel->shortT, data->param.command.shortcut); WMSetTextFieldText(panel->shortT, data->param.command.shortcut);
switch (data->param.command.command) {
case 6:
WMSetTextFieldText(panel->paramT,
data->param.command.parameter);
break;
}
icommandLClicked(panel->icommandL, panel);
break; break;
case PipeInfo: case PipeInfo:

View File

@@ -404,6 +404,8 @@ itemSelectObserver(void *self, WMNotification *notif)
if (menu->selectedItem && !menu->selectedItem->submenu) { if (menu->selectedItem && !menu->selectedItem->submenu) {
deselectItem(menu); deselectItem(menu);
if (menu->flags.isEditing)
stopEditItem(menu, False);
} }
} }
@@ -1201,6 +1203,8 @@ dragMenu(WEditMenu *menu)
break; break;
case MotionNotify: case MotionNotify:
while (XCheckMaskEvent(scr->display, ButtonMotionMask, &ev)) ;
WMMoveWidget(menu, ev.xmotion.x_root - dx, WMMoveWidget(menu, ev.xmotion.x_root - dx,
ev.xmotion.y_root - dy); ev.xmotion.y_root - dy);
break; break;
@@ -1320,6 +1324,8 @@ dragItem(WEditMenu *menu, WEditMenuItem *item)
switch (ev.type) { switch (ev.type) {
case MotionNotify: case MotionNotify:
while (XCheckMaskEvent(dpy, ButtonMotionMask, &ev)) ;
XQueryPointer(dpy, win, &blaw, &blaw, &blai, &blai, &x, &y, &blau); XQueryPointer(dpy, win, &blaw, &blaw, &blai, &blai, &x, &y, &blau);
dmenu = findMenuInWindow(dpy, win, x, y); dmenu = findMenuInWindow(dpy, win, x, y);