1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-08 14:54:13 +01:00

GNOME mouseclickproxy thing fix

added WorkspaceNameDisplayPosition
balloon updates
bug fixes
This commit is contained in:
kojima
1999-04-25 21:43:50 +00:00
parent fe2e0156e0
commit d3609d3449
28 changed files with 3473 additions and 1573 deletions

View File

@@ -200,6 +200,17 @@ typedef enum {
#define MS_FLAT 2
/* workspace display position */
#define WD_NONE 0
#define WD_CENTER 1
#define WD_TOP 2
#define WD_BOTTOM 3
#define WD_TOPLEFT 4
#define WD_TOPRIGHT 5
#define WD_BOTTOMLEFT 6
#define WD_BOTTOMRIGHT 7
/* program states */
#define WSTATE_NORMAL 0
#define WSTATE_NEED_EXIT 1
@@ -339,13 +350,15 @@ typedef struct WPreferences {
int menu_style; /* menu decoration style */
int workspace_name_display_position;
unsigned int modifier_mask; /* mask to use as kbd modifier */
char ws_advance; /* Create new workspace and advance */
char ws_cycle; /* Cycle existing workspaces */
unsigned int modifier_mask; /* mask to use as kbd modifier */
char save_session_on_exit; /* automatically save session on exit */
char sticky_icons; /* If miniwindows will be onmipresent */
@@ -369,9 +382,8 @@ typedef struct WPreferences {
char window_balloon;
char miniwin_balloon;
char appicon_balloon;
char no_workspace_name_display;
char help_balloon;
#ifdef WEENDOZE_CYCLE
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */

View File

@@ -914,6 +914,10 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
XFreePixmap(dpy, ghost);
XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
}
if (wPreferences.auto_arrange_icons)
wArrangeIcons(scr, True);
done = 1;
break;
}

View File

@@ -296,6 +296,18 @@ static WOptionEnumeration seMenuStyles[] = {
};
static WOptionEnumeration seDisplayPositions[] = {
{"none", WD_NONE, 0},
{"center", WD_CENTER, 0},
{"top", WD_TOP, 0},
{"bottom", WD_BOTTOM, 0},
{"topleft", WD_TOPLEFT, 0},
{"topright", WD_TOPRIGHT, 0},
{"bottomleft", WD_BOTTOMLEFT, 0},
{"bottomright", WD_BOTTOMRIGHT, 0}
};
/*
* ALL entries in the tables bellow, NEED to have a default value
* defined, and this value needs to be correct.
@@ -387,8 +399,8 @@ WDefaultEntry optionList[] = {
{"CycleWorkspaces", "NO", NULL,
&wPreferences.ws_cycle, getBool, NULL
},
{"IAmAnnoyingAndDontWantWorkspaceNameDisplay", "NO",NULL,
&wPreferences.no_workspace_name_display, getBool, NULL
{"WorkspaceNameDisplayPosition", "center", seDisplayPositions,
&wPreferences.workspace_name_display_position, getEnum, NULL
},
{"StickyIcons", "NO", NULL,
&wPreferences.sticky_icons, getBool, setStickyIcons
@@ -417,7 +429,7 @@ WDefaultEntry optionList[] = {
{"AlignSubmenus", "NO", NULL,
&wPreferences.align_menus, getBool, NULL
},
{"OpenTransientOnOwnerWorkspace", "NO", NULL,
{"OpenTransientOnOwnerWorkspace", "NO", NULL,
&wPreferences.open_transients_with_parent, getBool, NULL
},
{"WindowPlacement", "auto", sePlacements,
@@ -471,6 +483,9 @@ WDefaultEntry optionList[] = {
{"AppIconBalloons", "NO", NULL,
&wPreferences.appicon_balloon,getBool, NULL
},
{"HelpBalloons", "NO", NULL,
&wPreferences.help_balloon, getBool, NULL
},
{"EdgeResistance", "30", NULL,
&wPreferences.edge_resistance,getInt, NULL
},
@@ -776,7 +791,7 @@ initDefaults()
else
entry->plvalue = NULL;
}
for (i=0; i<sizeof(staticOptionList)/sizeof(WDefaultEntry); i++) {
entry = &staticOptionList[i];

View File

@@ -617,11 +617,6 @@ handleButtonPress(XEvent *event)
#ifndef LITE
if (event->xbutton.window==scr->root_win) {
#ifdef GNOME_STUFF
if (wGNOMEProxyizeButtonEvent(scr, event))
return;
#endif
if (event->xbutton.button==wPreferences.menu_button) {
OpenRootMenu(scr, event->xbutton.x_root,
event->xbutton.y_root, False);
@@ -656,6 +651,10 @@ handleButtonPress(XEvent *event)
}
#endif /* MOUSE_WS_SWITCH */
#ifdef GNOME_STUFF
else if (wGNOMEProxyizeButtonEvent(scr, event))
return;
#endif
}
#endif /* !LITE */

View File

@@ -555,15 +555,6 @@ wGNOMEProcessClientMessage(XClientMessageEvent *event)
Bool
wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event)
{
#ifndef MOUSE_WS_SWITCH
if (event->xbutton.button <= Button3
&& (event->xbutton.state & ValidModMask) == 0)
return False;
#else
if ((event->xbutton.state & ValidModMask) == 0)
return False;
#endif
if (event->type == ButtonPress)
XUngrabPointer(dpy, CurrentTime);
XSendEvent(dpy, scr->no_focus_win, False, SubstructureNotifyMask, event);

View File

@@ -3,7 +3,7 @@
*
* WindowMaker window manager
*
* Copyright (c) 1997 Alfredo K. Kojima
* Copyright (c) 1997-199 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -300,7 +300,7 @@
#define DEF_CLIP_TITLE_FONT "\"-*-*-medium-r-normal--10-*\""
#define DEF_INFO_TEXT_FONT "\"-*-*-medium-r-normal--14-*\""
#define DEF_WORKSPACE_NAME_FONT "-*-*-medium-r-normal--24-*"
#define DEF_WORKSPACE_NAME_FONT "\"-*-*-medium-r-normal--24-*\""
#else /* !I18N_MB */
#define DEF_TITLE_FONT "\"-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*\""
#define DEF_MENU_TITLE_FONT "\"-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*\""
@@ -309,7 +309,7 @@
#define DEF_CLIP_TITLE_FONT "\"-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*\""
#define DEF_INFO_TEXT_FONT "\"-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*\""
#define DEF_WORKSPACE_NAME_FONT "-*-lucida-bold-r-*-*-24-*-*-*-*-*-*-*"
#define DEF_WORKSPACE_NAME_FONT "\"-*-lucida-bold-r-*-*-24-*-*-*-*-*-*-*\""
#endif /* !I18N_MB */
#define HELVETICA10_FONT "-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"
@@ -425,7 +425,7 @@
/* workspace name on switch display */
#define WORKSPACE_NAME_FADE_DELAY 30
#define WORKSPACE_NAME_DELAY 500
#define WORKSPACE_NAME_DELAY 400
/* window birth animation steps (DO NOT MAKE IT RUN-TIME) */
#define WINDOW_BIRTH_STEPS 20

View File

@@ -302,7 +302,7 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
APPLY_VAL(value, emulate_appicon, AEmulateAppIcon);
value = get_value(dw, dc, dn, da, AFullMaximize, No, useGlobalDefault);
APPLY_VAL(value, emulate_appicon, AFullMaximize);
APPLY_VAL(value, full_maximize, AFullMaximize);
/* clean up */
PLSetStringCmpHook(StringCompareHook);

View File

@@ -1117,47 +1117,65 @@ createInspectorForWindow(WWindow *wwin)
for (i=0; i < 10; i++) {
char *caption = NULL;
int flag = 0;
char *descr = NULL;
switch (i) {
case 0:
caption = _("Disable Titlebar");
flag = WFLAGP(wwin, no_titlebar);
descr = _("Remove the titlebar of this window.\n"
"To access the window commands menu of a window\n"
"without it's titlebar, press Control+Esc (or the\n"
"equivalent shortcut, if you changed the default\n"
"settings).");
break;
case 1:
caption = _("Disable Resizebar");
flag = WFLAGP(wwin, no_resizebar);
descr = _("Remove the resizebar of this window.");
break;
case 2:
caption = _("Disable Close Button");
flag = WFLAGP(wwin, no_close_button);
descr = _("Remove the `close window' button of this window.");
break;
case 3:
caption = _("Disable Miniaturize Button");
flag = WFLAGP(wwin, no_miniaturize_button);
descr = _("Remove the `miniaturize window' button of the window.");
break;
case 4:
caption = _("Keep on Top / Floating");
flag = WFLAGP(wwin, floating);
descr = _("Keep the window over other windows, not allowing\n"
"them to covert it.");
break;
case 5:
caption = _("Keep at Bottom / Sunken");
flag = WFLAGP(wwin, sunken);
descr = _("Keep the window under all other windows.");
break;
case 6:
caption = _("Omnipresent");
flag = WFLAGP(wwin, omnipresent);
descr = _("Make window occupy all workspaces.");
break;
case 7:
caption = _("Start Miniaturized");
flag = WFLAGP(wwin, start_miniaturized);
descr = _("Make the window be automatically miniaturized when it's\n"
"first shown.");
break;
case 8:
caption = _("Start Maximized");
flag = WFLAGP(wwin, start_maximized!=0);
descr = _("Make the window be automatically maximized when it's\n"
"first shown.");
break;
case 9:
caption = _("Skip Window List");
flag = WFLAGP(wwin, skip_window_list);
descr = _("Do not list the window in the window list menu.");
break;
}
panel->attrChk[i] = WMCreateSwitchButton(panel->attrFrm);
@@ -1165,6 +1183,8 @@ createInspectorForWindow(WWindow *wwin)
WMResizeWidget(panel->attrChk[i], frame_width-15, 20);
WMSetButtonSelected(panel->attrChk[i], flag);
WMSetButtonText(panel->attrChk[i], caption);
WMSetBalloonTextForView(descr, WMWidgetView(panel->attrChk[i]));
}
@@ -1177,39 +1197,63 @@ createInspectorForWindow(WWindow *wwin)
for (i=0; i < 8; i++) {
char *caption = NULL;
int flag = 0;
char *descr = NULL;
switch (i) {
case 0:
caption = _("Ignore HideOthers");
flag = WFLAGP(wwin, no_hide_others);
descr = _("Do not hide the window when issuing the\n"
"`HideOthers' command.");
break;
case 1:
caption = _("Don't Bind Keyboard Shortcuts");
flag = WFLAGP(wwin, no_bind_keys);
descr = _("Do not bind keyboard shortcuts from Window Maker\n"
"when this window is focused. This will allow the\n"
"window to receive all key combinations regardless\n"
"of your shortcut configuration.");
break;
case 2:
caption = _("Don't Bind Mouse Clicks");
flag = WFLAGP(wwin, no_bind_mouse);
descr = _("Do not bind mouse actions, such as `Alt'+drag\n"
"in the window (when alt is the modifier you have"
"configured).");
break;
case 3:
caption = _("Keep Inside Screen");
flag = WFLAGP(wwin, dont_move_off);
descr = _("Do not allow the window to move itself completely\n"
"outside the screen. For bug compatibility.\n");
break;
case 4:
caption = _("Don't Let It Take Focus");
flag = WFLAGP(wwin, no_focusable);
descr = _("Do not let the window take keyboard focus when you\n"
"click on it.");
break;
case 5:
caption = _("Don't Save Session");
flag = WFLAGP(wwin, dont_save_session);
descr = _("Do not save the associated application in the\n"
"session's state, so that it won't be restarted\n"
"together with other applications when Window Maker\n"
"starts.");
break;
case 6:
caption = _("Emulate Application Icon");
flag = WFLAGP(wwin, emulate_appicon);
descr = _("Make this window act as an application that provides\n"
"enough information to Window Maker for a dockable\n"
"application icon to be created.");
break;
case 7:
caption = _("Full Screen Maximization");
flag = WFLAGP(wwin, full_maximize);
descr = _("Make the window use the whole screen space when it's\n"
"maximized. The titlebar and resizebar will be moved\n"
"to outside the screen.");
break;
}
panel->moreChk[i] = WMCreateSwitchButton(panel->moreFrm);
@@ -1217,14 +1261,9 @@ createInspectorForWindow(WWindow *wwin)
WMResizeWidget(panel->moreChk[i], frame_width-15, 20);
WMSetButtonSelected(panel->moreChk[i], flag);
WMSetButtonText(panel->moreChk[i], caption);
}
panel->moreLbl = WMCreateLabel(panel->moreFrm);
WMResizeWidget(panel->moreLbl, frame_width - (2 * 5), 60);
WMMoveWidget(panel->moreLbl, 5, 180);
WMSetLabelText(panel->moreLbl,
_("Enable the \"Don't bind...\" options to allow the "
"application to receive all mouse or keyboard events."));
WMSetBalloonTextForView(descr, WMWidgetView(panel->moreChk[i]));
}
/* miniwindow/workspace */
panel->iconFrm = WMCreateFrame(panel->win);
@@ -1285,6 +1324,9 @@ createInspectorForWindow(WWindow *wwin)
WMResizeWidget(panel->wsFrm, PWIDTH - (2 * 15), 70);
WMSetFrameTitle(panel->wsFrm, _("Initial Workspace"));
WMSetBalloonTextForView(_("The workspace to place the window when it's"
"first shown."), WMWidgetView(panel->wsFrm));
panel->wsP = WMCreatePopUpButton(panel->wsFrm);
WMMoveWidget(panel->wsP, 20, 30);
WMResizeWidget(panel->wsP, PWIDTH - (2 * 15) - (2 * 20), 20);
@@ -1313,15 +1355,21 @@ createInspectorForWindow(WWindow *wwin)
for (i=0; i < 2; i++) {
char *caption = NULL;
int flag = 0;
char *descr = NULL;
switch (i) {
case 0:
caption = _("Start Hidden");
flag = WFLAGP(wapp->main_window_desc, start_hidden);
descr = _("Automatically hide application when it's started.");
break;
case 1:
caption = _("No Application Icon");
flag = WFLAGP(wapp->main_window_desc, no_appicon);
descr = _("Disable the application icon for the application.\n"
"Note that you won't be able to dock it anymore,\n"
"and any icons that are already docked will stop\n"
"working correctly.");
break;
}
panel->appChk[i] = WMCreateSwitchButton(panel->appFrm);
@@ -1329,6 +1377,8 @@ createInspectorForWindow(WWindow *wwin)
WMResizeWidget(panel->appChk[i], 205, 20);
WMSetButtonSelected(panel->appChk[i], flag);
WMSetButtonText(panel->appChk[i], caption);
WMSetBalloonTextForView(descr, WMWidgetView(panel->appChk[i]));
}
if (WFLAGP(wwin, emulate_appicon)) {
@@ -1421,7 +1471,9 @@ void
wShowInspectorForWindow(WWindow *wwin)
{
if (wwin->flags.inspector_open)
return;
return;
WMSetBalloonEnabled(wwin->screen_ptr->wmscreen, wPreferences.help_balloon);
make_keys();
wwin->flags.inspector_open = 1;

View File

@@ -61,8 +61,6 @@ typedef struct InspectorPanel {
/* 3rd page. more attributes */
WMFrame *moreFrm;
WMButton *moreChk[8];
WMLabel *moreLbl;
/* 4th page. icon and workspace */
WMFrame *iconFrm;

View File

@@ -281,10 +281,14 @@ showWorkspaceName(WScreen *scr, int workspace)
RXImage *ximg;
Pixmap text, mask;
int w, h;
int px, py;
char *name = scr->workspaces[workspace]->name;
int len = strlen(name);
int x, y;
if (wPreferences.workspace_name_display_position == WD_NONE)
return;
if (scr->workspace_name_timer) {
WMDeleteTimerHandler(scr->workspace_name_timer);
XUnmapWindow(dpy, scr->workspace_name);
@@ -309,11 +313,38 @@ showWorkspaceName(WScreen *scr, int workspace)
w = wTextWidth(scr->workspace_name_font->font, name, len);
h = scr->workspace_name_font->height;
switch (wPreferences.workspace_name_display_position) {
case WD_CENTER:
px = (scr->scr_width - (w+4))/2;
py = (scr->scr_height - (h+4))/2;
break;
case WD_TOP:
px = (scr->scr_width - (w+4))/2;
py = 0;
break;
case WD_BOTTOM:
px = (scr->scr_width - (w+4))/2;
py = scr->scr_height - h;
break;
case WD_TOPLEFT:
px = 0;
py = 0;
break;
case WD_TOPRIGHT:
px = scr->scr_width - w;
py = 0;
break;
case WD_BOTTOMLEFT:
px = 0;
py = scr->scr_height - h;
break;
case WD_BOTTOMRIGHT:
px = scr->scr_width - w;
py = scr->scr_height - h;
break;
}
XResizeWindow(dpy, scr->workspace_name, w+4, h+4);
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, 0);
/*
(scr->scr_height - (h+4))/2);
*/
XMoveWindow(dpy, scr->workspace_name, px, py);
text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth);
mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1);
@@ -356,9 +387,7 @@ showWorkspaceName(WScreen *scr, int workspace)
goto erro;
}
ximg = RGetXImage(scr->rcontext, scr->root_win,
(scr->scr_width - data->text->width)/2,
0 /* (scr->scr_height - data->text->height)/2 */,
ximg = RGetXImage(scr->rcontext, scr->root_win, px, py,
data->text->width, data->text->height);
if (!ximg) {
@@ -409,8 +438,7 @@ wWorkspaceChange(WScreen *scr, int workspace)
if (workspace != scr->current_workspace) {
wWorkspaceForceChange(scr, workspace);
} else {
if (!wPreferences.no_workspace_name_display)
showWorkspaceName(scr, workspace);
showWorkspaceName(scr, workspace);
}
}
@@ -577,8 +605,7 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
}
}
if (!wPreferences.no_workspace_name_display)
showWorkspaceName(scr, workspace);
showWorkspaceName(scr, workspace);
#ifdef GNOME_STUFF
wGNOMEUpdateCurrentWorkspaceHint(scr);