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

@@ -97,6 +97,9 @@ typedef struct _Panel {
WMList *icommandL;
WMFrame *paramF;
WMTextField *paramT;
Bool dontAsk; /* whether to comfirm submenu remove */
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
createPanel(_Panel *p)
{
@@ -223,7 +242,6 @@ createPanel(_Panel *p)
WMScreen *scr = WMWidgetScreen(panel->win);
WMColor *black = WMBlackColor(scr);
WMColor *white = WMWhiteColor(scr);
WMColor *dark = WMDarkGrayColor(scr);
WMColor *gray = WMGrayColor(scr);
WMFont *bold = WMBoldSystemFontOfSize(scr, 12);
WMFont *font = WMSystemFontOfSize(scr, 12);
@@ -510,18 +528,11 @@ createPanel(_Panel *p)
/* 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);
WMResizeWidget(panel->icommandL, width, 80);
WMMoveWidget(panel->icommandL, 10, 43);
WMMoveWidget(panel->icommandL, 10, 20);
WMSetListAction(panel->icommandL, icommandLClicked, panel);
WMAddNotificationObserver(dataChanged, panel,
WMListSelectionDidChangeNotification,
@@ -543,13 +554,23 @@ createPanel(_Panel *p)
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);
WMMapSubwidgets(panel->frame);
WMMapWidget(panel->frame);
panel->sections[ExecInfo][0] = panel->commandF;
panel->sections[ExecInfo][1] = panel->shortF;
@@ -852,6 +873,13 @@ updateMenuItem(_Panel *panel, WEditMenuItem *item, WMWidget *changedWidget)
if (changedWidget == panel->icommandL) {
data->param.command.command =
WMGetListSelectedItemRow(panel->icommandL);
switch (data->param.command.command) {
case 6:
data->param.command.parameter =
WMGetTextFieldText(panel->paramT);
break;
}
}
if (changedWidget == panel->shortT) {
REPLACE(data->param.command.shortcut,
@@ -1030,6 +1058,15 @@ menuItemSelected(WEditMenuDelegate *delegate, WEditMenu *menu,
WMSetListPosition(panel->icommandL,
data->param.command.command - 2);
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;
case PipeInfo:

View File

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