mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-18 14:13:32 +02:00
Compare commits
14 Commits
2fb9308a67
...
7b317a5fba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b317a5fba | ||
|
|
9f8dc6f5dc | ||
|
|
bc56db0776 | ||
|
|
15d06ff064 | ||
|
|
2dd98666f1 | ||
|
|
d1a7db8aea | ||
|
|
64a8ecb390 | ||
|
|
a9e336256b | ||
|
|
e9b20b51e9 | ||
|
|
1d8b38b6e0 | ||
|
|
82ad19d420 | ||
|
|
492b22d975 | ||
|
|
62405fbb75 | ||
|
|
f1fef40f0d |
@@ -1,3 +1,9 @@
|
|||||||
|
Changes since wmaker 0.95.10:
|
||||||
|
............................
|
||||||
|
|
||||||
|
- added W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls
|
||||||
|
|
||||||
|
|
||||||
Changes since wmaker 0.92.0:
|
Changes since wmaker 0.92.0:
|
||||||
............................
|
............................
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
** API and ABI modifications since wmaker 0.92.0
|
** API and ABI modifications since wmaker 0.95.10
|
||||||
|
----------------------------------------------------
|
||||||
|
|
||||||
** libWINGs **
|
** libWINGs **
|
||||||
<WINGsP.h>
|
<WINGsP.h>
|
||||||
|
W_KeycodeToKeysym ADDED
|
||||||
struct W_DragDestinationInfo: new members added SIZE CHANGE
|
struct W_DragDestinationInfo: new members added SIZE CHANGE
|
||||||
|
|
||||||
<WINGs.h>
|
<WINGs.h>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#define WINGS_H_VERSION 20210726
|
#define WINGS_H_VERSION 20230226
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -494,6 +494,8 @@ void W_SetPreeditPositon(W_View *view, int x, int y);
|
|||||||
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
|
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
|
||||||
int buflen, KeySym *keysym, Status *status);
|
int buflen, KeySym *keysym, Status *status);
|
||||||
|
|
||||||
|
KeySym W_KeycodeToKeysym(Display *display, KeyCode keycode, int index);
|
||||||
|
|
||||||
|
|
||||||
/* ---[ wmisc.c ]--------------------------------------------------------- */
|
/* ---[ wmisc.c ]--------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ static void menu_parser_condition_ifmacro(WMenuParser parser, Bool check_exists)
|
|||||||
macro = menu_parser_find_macro(parser, macro_name);
|
macro = menu_parser_find_macro(parser, macro_name);
|
||||||
parser->cond.stack[0].skip =
|
parser->cond.stack[0].skip =
|
||||||
((check_exists) && (macro == NULL)) ||
|
((check_exists) && (macro == NULL)) ||
|
||||||
((!check_exists) && (macro != NULL)) ;
|
((!check_exists) && (macro != NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(parser->cond.stack[0].name, cmd_name);
|
strcpy(parser->cond.stack[0].name, cmd_name);
|
||||||
|
|||||||
@@ -279,7 +279,8 @@ WParserMacro *menu_parser_find_macro(WMenuParser parser, const char *name)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
return macro;
|
return macro;
|
||||||
check_next_macro: ;
|
check_next_macro:
|
||||||
|
;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,3 +213,35 @@ int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer, int bufl
|
|||||||
#endif
|
#endif
|
||||||
return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
|
return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Map a keycode to the corresponding keysym
|
||||||
|
* To replace the deprecated X11 function XKeycodeToKeysym
|
||||||
|
*/
|
||||||
|
KeySym W_KeycodeToKeysym(Display *display, KeyCode keycode, int index)
|
||||||
|
{
|
||||||
|
static int min_kc = -1;
|
||||||
|
static int max_kc;
|
||||||
|
int num_syms;
|
||||||
|
KeySym *key_syms;
|
||||||
|
KeySym ks;
|
||||||
|
|
||||||
|
if (min_kc == -1) {
|
||||||
|
(void) XDisplayKeycodes(display, &min_kc, &max_kc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keycode < min_kc || keycode > max_kc || index < 0) {
|
||||||
|
return NoSymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
key_syms = XGetKeyboardMapping(display, keycode, 1, &num_syms);
|
||||||
|
if (index >= num_syms) {
|
||||||
|
XFree(key_syms);
|
||||||
|
return NoSymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
ks = key_syms[index];
|
||||||
|
XFree(key_syms);
|
||||||
|
|
||||||
|
return ks;
|
||||||
|
}
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ static void paintText(Text * tPtr)
|
|||||||
TextBlock *tb;
|
TextBlock *tb;
|
||||||
WMFont *font;
|
WMFont *font;
|
||||||
const char *text;
|
const char *text;
|
||||||
int len, y, c, s, done = False, dir /* 1 = down */ ;
|
int len, y, c, s, done = False, dir; /* dir 1 = down */
|
||||||
WMScreen *scr = tPtr->view->screen;
|
WMScreen *scr = tPtr->view->screen;
|
||||||
Display *dpy = tPtr->view->screen->display;
|
Display *dpy = tPtr->view->screen->display;
|
||||||
Window win = tPtr->view->window;
|
Window win = tPtr->view->window;
|
||||||
|
|||||||
@@ -661,7 +661,7 @@ static void didResizeTextField(W_ViewDelegate * self, WMView * view)
|
|||||||
|
|
||||||
tPtr->offsetWidth = WMAX((tPtr->view->size.height - WMFontHeight(tPtr->font)) / 2, 1);
|
tPtr->offsetWidth = WMAX((tPtr->view->size.height - WMFontHeight(tPtr->font)) / 2, 1);
|
||||||
|
|
||||||
tPtr->usableWidth = tPtr->view->size.width - 2 * tPtr->offsetWidth /*+ 2 */ ;
|
tPtr->usableWidth = tPtr->view->size.width - 2 * tPtr->offsetWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *makeHiddenString(int length)
|
static char *makeHiddenString(int length)
|
||||||
|
|||||||
@@ -317,11 +317,8 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
|
|||||||
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
|
if (ev.type == KeyPress && ev.xkey.keycode != 0) {
|
||||||
numlock_mask = NumLockMask(dpy);
|
numlock_mask = NumLockMask(dpy);
|
||||||
|
|
||||||
if (xext_xkb_supported)
|
/* conditional mask check to get numeric keypad keys */
|
||||||
/* conditional mask check to get numeric keypad keys */
|
ksym = W_KeycodeToKeysym(dpy, ev.xkey.keycode, ev.xkey.state & numlock_mask?1:0);
|
||||||
ksym = XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, ev.xkey.state & numlock_mask?1:0);
|
|
||||||
else
|
|
||||||
ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, ev.xkey.state & numlock_mask?1:0);
|
|
||||||
|
|
||||||
if (!IsModifierKey(ksym)) {
|
if (!IsModifierKey(ksym)) {
|
||||||
if (convert_case) {
|
if (convert_case) {
|
||||||
@@ -369,6 +366,36 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
|
|||||||
return wstrdup(buffer);
|
return wstrdup(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check if the keystr entered is already set to another action
|
||||||
|
* if found it returns the position in the keyOptions
|
||||||
|
*/
|
||||||
|
static int isKeySet(_Panel *panel, char *keystr)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
for (i = 0; i < panel->actionCount; i++) {
|
||||||
|
str = NULL;
|
||||||
|
if (panel->shortcuts[i]) {
|
||||||
|
str = wtrimspace(panel->shortcuts[i]);
|
||||||
|
if (strlen(str) == 0) {
|
||||||
|
wfree(str);
|
||||||
|
str = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (str) {
|
||||||
|
if (strcmp(keystr, str) == 0) {
|
||||||
|
wfree(str);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
wfree(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static void captureClick(WMWidget * w, void *data)
|
static void captureClick(WMWidget * w, void *data)
|
||||||
{
|
{
|
||||||
_Panel *panel = (_Panel *) data;
|
_Panel *panel = (_Panel *) data;
|
||||||
@@ -383,17 +410,31 @@ static void captureClick(WMWidget * w, void *data)
|
|||||||
XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
shortcut = capture_shortcut(dpy, &panel->capturing, 1);
|
shortcut = capture_shortcut(dpy, &panel->capturing, 1);
|
||||||
if (shortcut) {
|
if (shortcut) {
|
||||||
|
int key_idx = -1;
|
||||||
int row = WMGetListSelectedItemRow(panel->actLs);
|
int row = WMGetListSelectedItemRow(panel->actLs);
|
||||||
|
|
||||||
WMSetTextFieldText(panel->shoT, shortcut);
|
key_idx = isKeySet(panel, shortcut);
|
||||||
if (row >= 0) {
|
if (key_idx >= 0 && (key_idx != row)) {
|
||||||
if (panel->shortcuts[row])
|
char *msg;
|
||||||
wfree(panel->shortcuts[row]);
|
|
||||||
panel->shortcuts[row] = shortcut;
|
|
||||||
|
|
||||||
WMRedisplayWidget(panel->actLs);
|
msg = wstrconcat(_("Key shortcut already in use by the "), _(keyOptions[key_idx].title));
|
||||||
} else {
|
WMRunAlertPanel(WMWidgetScreen(w), GetWindow(),
|
||||||
|
_("Error"),
|
||||||
|
msg,
|
||||||
|
_("OK"), NULL, NULL);
|
||||||
|
wfree(msg);
|
||||||
wfree(shortcut);
|
wfree(shortcut);
|
||||||
|
} else {
|
||||||
|
WMSetTextFieldText(panel->shoT, shortcut);
|
||||||
|
if (row >= 0) {
|
||||||
|
if (panel->shortcuts[row])
|
||||||
|
wfree(panel->shortcuts[row]);
|
||||||
|
panel->shortcuts[row] = shortcut;
|
||||||
|
|
||||||
|
WMRedisplayWidget(panel->actLs);
|
||||||
|
} else {
|
||||||
|
wfree(shortcut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,10 +381,7 @@ static void fillModifierPopUp(WMPopUpButton * pop)
|
|||||||
if (mapping->modifiermap[idx] != 0) {
|
if (mapping->modifiermap[idx] != 0) {
|
||||||
int l;
|
int l;
|
||||||
for (l = 0; l < 4; l++) {
|
for (l = 0; l < 4; l++) {
|
||||||
if (xext_xkb_supported)
|
ksym = W_KeycodeToKeysym(dpy, mapping->modifiermap[idx], l);
|
||||||
ksym = XkbKeycodeToKeysym(dpy, mapping->modifiermap[idx], 0, l);
|
|
||||||
else
|
|
||||||
ksym = XKeycodeToKeysym(dpy, mapping->modifiermap[idx], l);
|
|
||||||
if (ksym != NoSymbol)
|
if (ksym != NoSymbol)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <wraster.h>
|
#include <wraster.h>
|
||||||
|
|
||||||
#include <WINGs/WINGs.h>
|
#include <WINGs/WINGs.h>
|
||||||
|
#include <WINGs/WINGsP.h>
|
||||||
|
|
||||||
/* Needed for HAVE_LIBINTL_H and EXTENDED_WINDOWSHORTCUT */
|
/* Needed for HAVE_LIBINTL_H and EXTENDED_WINDOWSHORTCUT */
|
||||||
#include "../src/wconfig.h"
|
#include "../src/wconfig.h"
|
||||||
@@ -54,7 +55,6 @@
|
|||||||
/****/
|
/****/
|
||||||
|
|
||||||
extern char *NOptionValueChanged;
|
extern char *NOptionValueChanged;
|
||||||
extern Bool xext_xkb_supported;
|
|
||||||
|
|
||||||
typedef struct _Panel Panel;
|
typedef struct _Panel Panel;
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *NOptionValueChanged = "NOptionValueChanged";
|
char *NOptionValueChanged = "NOptionValueChanged";
|
||||||
Bool xext_xkb_supported = False;
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_DEATHS 64
|
#define MAX_DEATHS 64
|
||||||
|
|
||||||
@@ -157,8 +155,6 @@ int main(int argc, char **argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
xext_xkb_supported = XkbQueryExtension(dpy, NULL, NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
WMPLSetCaseSensitive(False);
|
WMPLSetCaseSensitive(False);
|
||||||
|
|
||||||
Initialize(scr);
|
Initialize(scr);
|
||||||
|
|||||||
@@ -171,10 +171,7 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
KeySym sym;
|
KeySym sym;
|
||||||
|
|
||||||
if (code) {
|
if (code) {
|
||||||
if (xext_xkb_supported)
|
sym = W_KeycodeToKeysym(display, code, column);
|
||||||
sym = XkbKeycodeToKeysym(display, code, 0, column);
|
|
||||||
else
|
|
||||||
sym = XKeycodeToKeysym(display, code, column);
|
|
||||||
} else {
|
} else {
|
||||||
sym = NoSymbol;
|
sym = NoSymbol;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
|
|||||||
AC_SUBST(WRASTER_VERSION)
|
AC_SUBST(WRASTER_VERSION)
|
||||||
dnl
|
dnl
|
||||||
dnl libWINGs
|
dnl libWINGs
|
||||||
WINGS_CURRENT=4
|
WINGS_CURRENT=5
|
||||||
WINGS_REVISION=0
|
WINGS_REVISION=0
|
||||||
WINGS_AGE=1
|
WINGS_AGE=2
|
||||||
WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
|
WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
|
||||||
AC_SUBST(WINGS_VERSION)
|
AC_SUBST(WINGS_VERSION)
|
||||||
dnl
|
dnl
|
||||||
@@ -270,8 +270,8 @@ supported_gfx=""
|
|||||||
dnl Platform-specific Makefile setup
|
dnl Platform-specific Makefile setup
|
||||||
dnl ================================
|
dnl ================================
|
||||||
AS_CASE(["$host"],
|
AS_CASE(["$host"],
|
||||||
[*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"],
|
[*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=700"],
|
||||||
[*-*-freebsd*|*-k*bsd-gnu*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"],
|
[*-*-freebsd*|*-k*bsd-gnu*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=700 -DFREEBSD"],
|
||||||
[*-*-netbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
|
[*-*-netbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
|
||||||
[*-*-openbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
|
[*-*-openbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
|
||||||
[*-*-dragonfly*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
|
[*-*-dragonfly*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
|
||||||
|
|||||||
4
doc/build/Compilation.texi
vendored
4
doc/build/Compilation.texi
vendored
@@ -551,6 +551,10 @@ Disable use of the @emph{MIT shared memory} extension.
|
|||||||
This will slow down texture generation a little bit, but in some cases it seems to be necessary due
|
This will slow down texture generation a little bit, but in some cases it seems to be necessary due
|
||||||
to a bug that manifests as messed icons and textures.
|
to a bug that manifests as messed icons and textures.
|
||||||
|
|
||||||
|
@item --disable-res
|
||||||
|
Disables support for @emph{XRes} resource window extension support.
|
||||||
|
Which is used to find the underlying processes (and PIDs) displaying the windows.
|
||||||
|
|
||||||
@item --disable-shape
|
@item --disable-shape
|
||||||
Disables support for @emph{shaped} windows (for @command{oclock}, @command{xeyes}, etc.).
|
Disables support for @emph{shaped} windows (for @command{oclock}, @command{xeyes}, etc.).
|
||||||
|
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
|
|||||||
if (nheight != wwin->old_geometry.height)
|
if (nheight != wwin->old_geometry.height)
|
||||||
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
|
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS);
|
||||||
|
|
||||||
|
wWindowConstrainSize(wwin, (unsigned int *)&nwidth, (unsigned int *)&nheight);
|
||||||
wWindowConfigure(wwin, nx, ny, nwidth, nheight);
|
wWindowConfigure(wwin, nx, ny, nwidth, nheight);
|
||||||
wwin->old_geometry.x = nx;
|
wwin->old_geometry.x = nx;
|
||||||
wwin->old_geometry.y = ny;
|
wwin->old_geometry.y = ny;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ static WDECallbackUpdate setModifierKeyLabels;
|
|||||||
|
|
||||||
static WDECallbackConvert getCursor;
|
static WDECallbackConvert getCursor;
|
||||||
static WDECallbackUpdate setCursor;
|
static WDECallbackUpdate setCursor;
|
||||||
static WDECallbackUpdate updateDock ;
|
static WDECallbackUpdate updateDock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tables to convert strings to enumeration values.
|
* Tables to convert strings to enumeration values.
|
||||||
|
|||||||
@@ -2440,7 +2440,7 @@ static int restoreMenu(WScreen *scr, WMPropList *menu)
|
|||||||
static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path)
|
static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path)
|
||||||
{
|
{
|
||||||
WMPropList *key, *entry;
|
WMPropList *key, *entry;
|
||||||
char buffer[512];
|
char buffer[1024];
|
||||||
int i, x, y, res;
|
int i, x, y, res;
|
||||||
Bool lowered;
|
Bool lowered;
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
|
#include <WINGs/WINGsP.h>
|
||||||
#include <wraster.h>
|
#include <wraster.h>
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
@@ -840,7 +841,7 @@ char *GetShortcutKey(WShortKey key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key_name = XKeysymToString(XkbKeycodeToKeysym(dpy, key.keycode, 0, 0));
|
key_name = XKeysymToString(W_KeycodeToKeysym(dpy, key.keycode, 0));
|
||||||
if (!key_name)
|
if (!key_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ static WMPropList *sHost;
|
|||||||
static WMPropList *sWorkspace;
|
static WMPropList *sWorkspace;
|
||||||
static WMPropList *sShaded;
|
static WMPropList *sShaded;
|
||||||
static WMPropList *sMiniaturized;
|
static WMPropList *sMiniaturized;
|
||||||
|
static WMPropList *sMaximized;
|
||||||
static WMPropList *sHidden;
|
static WMPropList *sHidden;
|
||||||
static WMPropList *sGeometry;
|
static WMPropList *sGeometry;
|
||||||
static WMPropList *sShortcutMask;
|
static WMPropList *sShortcutMask;
|
||||||
@@ -112,6 +113,7 @@ static void make_keys(void)
|
|||||||
sWorkspace = WMCreatePLString("Workspace");
|
sWorkspace = WMCreatePLString("Workspace");
|
||||||
sShaded = WMCreatePLString("Shaded");
|
sShaded = WMCreatePLString("Shaded");
|
||||||
sMiniaturized = WMCreatePLString("Miniaturized");
|
sMiniaturized = WMCreatePLString("Miniaturized");
|
||||||
|
sMaximized = WMCreatePLString("Maximized");
|
||||||
sHidden = WMCreatePLString("Hidden");
|
sHidden = WMCreatePLString("Hidden");
|
||||||
sGeometry = WMCreatePLString("Geometry");
|
sGeometry = WMCreatePLString("Geometry");
|
||||||
sDock = WMCreatePLString("Dock");
|
sDock = WMCreatePLString("Dock");
|
||||||
@@ -166,6 +168,22 @@ static unsigned getInt(WMPropList * value)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned getHex(WMPropList * value)
|
||||||
|
{
|
||||||
|
char *val;
|
||||||
|
unsigned n;
|
||||||
|
|
||||||
|
if (!WMIsPLString(value))
|
||||||
|
return 0;
|
||||||
|
val = WMGetFromPLString(value);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
if (sscanf(val, "0x%04X", &n) != 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
||||||
{
|
{
|
||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
@@ -174,7 +192,7 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
|||||||
unsigned mask;
|
unsigned mask;
|
||||||
char *class, *instance, *command = NULL, buffer[512];
|
char *class, *instance, *command = NULL, buffer[512];
|
||||||
WMPropList *win_state, *cmd, *name, *workspace;
|
WMPropList *win_state, *cmd, *name, *workspace;
|
||||||
WMPropList *shaded, *miniaturized, *hidden, *geometry;
|
WMPropList *shaded, *miniaturized, *maximized, *hidden, *geometry;
|
||||||
WMPropList *dock, *shortcut;
|
WMPropList *dock, *shortcut;
|
||||||
|
|
||||||
if (wwin->orig_main_window != None && wwin->orig_main_window != wwin->client_win)
|
if (wwin->orig_main_window != None && wwin->orig_main_window != wwin->client_win)
|
||||||
@@ -207,6 +225,8 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
|||||||
|
|
||||||
shaded = wwin->flags.shaded ? sYes : sNo;
|
shaded = wwin->flags.shaded ? sYes : sNo;
|
||||||
miniaturized = wwin->flags.miniaturized ? sYes : sNo;
|
miniaturized = wwin->flags.miniaturized ? sYes : sNo;
|
||||||
|
snprintf(buffer, sizeof(buffer), "0x%04X", wwin->flags.maximized);
|
||||||
|
maximized = WMCreatePLString(buffer);
|
||||||
hidden = wwin->flags.hidden ? sYes : sNo;
|
hidden = wwin->flags.hidden ? sYes : sNo;
|
||||||
snprintf(buffer, sizeof(buffer), "%ix%i+%i+%i",
|
snprintf(buffer, sizeof(buffer), "%ix%i+%i+%i",
|
||||||
wwin->client.width, wwin->client.height, wwin->frame_x, wwin->frame_y);
|
wwin->client.width, wwin->client.height, wwin->frame_x, wwin->frame_y);
|
||||||
@@ -226,12 +246,14 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
|||||||
sWorkspace, workspace,
|
sWorkspace, workspace,
|
||||||
sShaded, shaded,
|
sShaded, shaded,
|
||||||
sMiniaturized, miniaturized,
|
sMiniaturized, miniaturized,
|
||||||
|
sMaximized, maximized,
|
||||||
sHidden, hidden,
|
sHidden, hidden,
|
||||||
sShortcutMask, shortcut, sGeometry, geometry, NULL);
|
sShortcutMask, shortcut, sGeometry, geometry, NULL);
|
||||||
|
|
||||||
WMReleasePropList(name);
|
WMReleasePropList(name);
|
||||||
WMReleasePropList(cmd);
|
WMReleasePropList(cmd);
|
||||||
WMReleasePropList(workspace);
|
WMReleasePropList(workspace);
|
||||||
|
WMReleasePropList(maximized);
|
||||||
WMReleasePropList(geometry);
|
WMReleasePropList(geometry);
|
||||||
WMReleasePropList(shortcut);
|
WMReleasePropList(shortcut);
|
||||||
if (wapp && wapp->app_icon && wapp->app_icon->dock) {
|
if (wapp && wapp->app_icon && wapp->app_icon->dock) {
|
||||||
@@ -408,6 +430,11 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
|
|||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
state->miniaturized = getBool(value);
|
state->miniaturized = getBool(value);
|
||||||
|
|
||||||
|
value = WMGetFromPLDictionary(win_state, sMaximized);
|
||||||
|
if (value != NULL) {
|
||||||
|
state->maximized = getHex(value);
|
||||||
|
}
|
||||||
|
|
||||||
value = WMGetFromPLDictionary(win_state, sHidden);
|
value = WMGetFromPLDictionary(win_state, sHidden);
|
||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
state->hidden = getBool(value);
|
state->hidden = getBool(value);
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ WTexSolid *wTextureMakeSolid(WScreen*, XColor*);
|
|||||||
WTexGradient *wTextureMakeGradient(WScreen*, int, const RColor*, const RColor*);
|
WTexGradient *wTextureMakeGradient(WScreen*, int, const RColor*, const RColor*);
|
||||||
WTexMGradient *wTextureMakeMGradient(WScreen*, int, RColor**);
|
WTexMGradient *wTextureMakeMGradient(WScreen*, int, RColor**);
|
||||||
WTexTGradient *wTextureMakeTGradient(WScreen*, int, const RColor*, const RColor*, const char *, int);
|
WTexTGradient *wTextureMakeTGradient(WScreen*, int, const RColor*, const RColor*, const char *, int);
|
||||||
WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
|
WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[2], int, const RColor[2]);
|
||||||
WTexPixmap *wTextureMakePixmap(WScreen *scr, int style, const char *pixmap_file,
|
WTexPixmap *wTextureMakePixmap(WScreen *scr, int style, const char *pixmap_file,
|
||||||
XColor *color);
|
XColor *color);
|
||||||
void wTextureDestroy(WScreen*, WTexture*);
|
void wTextureDestroy(WScreen*, WTexture*);
|
||||||
|
|||||||
39
src/window.c
39
src/window.c
@@ -919,6 +919,9 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
if (win_state->state->miniaturized > 0 && !WFLAGP(wwin, no_miniaturizable))
|
if (win_state->state->miniaturized > 0 && !WFLAGP(wwin, no_miniaturizable))
|
||||||
wwin->flags.miniaturized = win_state->state->miniaturized;
|
wwin->flags.miniaturized = win_state->state->miniaturized;
|
||||||
|
|
||||||
|
if (win_state->state->maximized > 0)
|
||||||
|
wwin->flags.maximized = win_state->state->maximized;
|
||||||
|
|
||||||
if (!IS_OMNIPRESENT(wwin)) {
|
if (!IS_OMNIPRESENT(wwin)) {
|
||||||
int w = wDefaultGetStartWorkspace(scr, wwin->wm_instance,
|
int w = wDefaultGetStartWorkspace(scr, wwin->wm_instance,
|
||||||
wwin->wm_class);
|
wwin->wm_class);
|
||||||
@@ -1732,9 +1735,8 @@ void wWindowSingleFocus(WWindow *wwin)
|
|||||||
/* bring window back to visible area */
|
/* bring window back to visible area */
|
||||||
move = wScreenBringInside(scr, &x, &y, wwin->frame->core->width, wwin->frame->core->height);
|
move = wScreenBringInside(scr, &x, &y, wwin->frame->core->width, wwin->frame->core->height);
|
||||||
|
|
||||||
if (move) {
|
if (move)
|
||||||
wWindowConfigure(wwin, x, y, wwin->client.width, wwin->client.height);
|
wWindowConfigure(wwin, x, y, wwin->client.width, wwin->client.height);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wWindowFocusPrev(WWindow *wwin, Bool inSameWorkspace)
|
void wWindowFocusPrev(WWindow *wwin, Bool inSameWorkspace)
|
||||||
@@ -1898,6 +1900,16 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
int baseW = 0;
|
int baseW = 0;
|
||||||
int baseH = 0;
|
int baseH = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X11 proto defines width and height as a CARD16
|
||||||
|
* if window size is guaranteed to fail, failsafe to a reasonable size
|
||||||
|
*/
|
||||||
|
if (width > USHRT_MAX && height > USHRT_MAX) {
|
||||||
|
width = 640;
|
||||||
|
height = 480;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (wwin->normal_hints) {
|
if (wwin->normal_hints) {
|
||||||
if (!wwin->flags.maximized) {
|
if (!wwin->flags.maximized) {
|
||||||
winc = wwin->normal_hints->width_inc;
|
winc = wwin->normal_hints->width_inc;
|
||||||
@@ -1918,15 +1930,19 @@ void wWindowConstrainSize(WWindow *wwin, unsigned int *nwidth, unsigned int *nhe
|
|||||||
baseH = wwin->normal_hints->base_height;
|
baseH = wwin->normal_hints->base_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* trust the mins provided by the client but not the maxs */
|
||||||
if (width < minW)
|
if (width < minW)
|
||||||
width = minW;
|
width = minW;
|
||||||
if (height < minH)
|
if (height < minH)
|
||||||
height = minH;
|
height = minH;
|
||||||
|
|
||||||
if (width > maxW)
|
/* if only one dimension is over the top, set a default 4/3 ratio */
|
||||||
width = maxW;
|
if (width > maxW && height < maxH) {
|
||||||
if (height > maxH)
|
width = height * 4 / 3;
|
||||||
height = maxH;
|
} else {
|
||||||
|
if(height > maxH && width < maxW)
|
||||||
|
height = width * 3 / 4;
|
||||||
|
}
|
||||||
|
|
||||||
/* aspect ratio code borrowed from olwm */
|
/* aspect ratio code borrowed from olwm */
|
||||||
if (minAX > 0) {
|
if (minAX > 0) {
|
||||||
@@ -2132,14 +2148,6 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||||||
int synth_notify = False;
|
int synth_notify = False;
|
||||||
int resize;
|
int resize;
|
||||||
|
|
||||||
/* if window size is guaranteed to fail - fix it to some reasonable
|
|
||||||
* defaults */
|
|
||||||
if (req_height > SHRT_MAX)
|
|
||||||
req_height = 480;
|
|
||||||
|
|
||||||
if (req_width > SHRT_MAX)
|
|
||||||
req_height = 640;
|
|
||||||
|
|
||||||
resize = (req_width != wwin->client.width || req_height != wwin->client.height);
|
resize = (req_width != wwin->client.width || req_height != wwin->client.height);
|
||||||
/*
|
/*
|
||||||
* if the window is being moved but not resized then
|
* if the window is being moved but not resized then
|
||||||
@@ -2694,7 +2702,7 @@ void wWindowUpdateGNUstepAttr(WWindow * wwin, GNUstepWMAttributes * attr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WMagicNumber wWindowAddSavedState(const char *instance, const char *class,
|
WMagicNumber wWindowAddSavedState(const char *instance, const char *class,
|
||||||
const char *command, pid_t pid, WSavedState * state)
|
const char *command, pid_t pid, WSavedState *state)
|
||||||
{
|
{
|
||||||
WWindowState *wstate;
|
WWindowState *wstate;
|
||||||
|
|
||||||
@@ -2929,7 +2937,6 @@ static void titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* maximize window */
|
/* maximize window */
|
||||||
|
|
||||||
if (dir != 0 && IS_RESIZABLE(wwin)) {
|
if (dir != 0 && IS_RESIZABLE(wwin)) {
|
||||||
int ndir = dir ^ wwin->flags.maximized;
|
int ndir = dir ^ wwin->flags.maximized;
|
||||||
|
|
||||||
|
|||||||
@@ -309,9 +309,9 @@ typedef struct WWindow {
|
|||||||
typedef struct WSavedState {
|
typedef struct WSavedState {
|
||||||
int workspace;
|
int workspace;
|
||||||
int miniaturized;
|
int miniaturized;
|
||||||
|
int maximized;
|
||||||
int shaded;
|
int shaded;
|
||||||
int hidden;
|
int hidden;
|
||||||
int maximized;
|
|
||||||
int x; /* original geometry of the */
|
int x; /* original geometry of the */
|
||||||
int y; /* window if it's maximized */
|
int y; /* window if it's maximized */
|
||||||
unsigned int w;
|
unsigned int w;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
|
|||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
#include <WINGs/WUtil.h>
|
#include <WINGs/WUtil.h>
|
||||||
|
#include <WINGs/WINGsP.h>
|
||||||
#include "WindowMaker.h"
|
#include "WindowMaker.h"
|
||||||
#include "xmodifier.h"
|
#include "xmodifier.h"
|
||||||
|
|
||||||
@@ -174,7 +175,7 @@ static void x_reset_modifier_mapping(Display * display)
|
|||||||
}
|
}
|
||||||
|
|
||||||
code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key];
|
code = x_modifier_keymap->modifiermap[modifier_index * mkpm + modifier_key];
|
||||||
sym = (code ? XkbKeycodeToKeysym(display, code, 0, column) : NoSymbol);
|
sym = (code ? W_KeycodeToKeysym(display, code, column) : NoSymbol);
|
||||||
|
|
||||||
if (sym == last_sym)
|
if (sym == last_sym)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -70,10 +70,13 @@ wmmenugen_SOURCES = wmmenugen.c wmmenugen.h wmmenugen_misc.c \
|
|||||||
wmmenugen_parse_wmconfig.c \
|
wmmenugen_parse_wmconfig.c \
|
||||||
wmmenugen_parse_xdg.c
|
wmmenugen_parse_xdg.c
|
||||||
|
|
||||||
|
wmiv_CFLAGS = @PANGO_CFLAGS@ @PTHREAD_CFLAGS@
|
||||||
|
|
||||||
wmiv_LDADD = \
|
wmiv_LDADD = \
|
||||||
$(top_builddir)/wrlib/libwraster.la \
|
$(top_builddir)/wrlib/libwraster.la \
|
||||||
@XLFLAGS@ @XLIBS@ \
|
$(top_builddir)/WINGs/libWINGs.la \
|
||||||
@GFXLIBS@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(LIBEXIF)
|
@XLFLAGS@ @XLIBS@ @GFXLIBS@ \
|
||||||
|
@PANGO_LIBS@ @PTHREAD_LIBS@ @LIBEXIF@
|
||||||
|
|
||||||
wmiv_SOURCES = wmiv.c wmiv.h
|
wmiv_SOURCES = wmiv.c wmiv.h
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,10 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/keysym.h>
|
|
||||||
#include <X11/XKBlib.h>
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include "wraster.h"
|
#include <WINGs/WINGsP.h>
|
||||||
|
#include <wraster.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -932,7 +931,7 @@ int main(int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (e.type == KeyPress) {
|
if (e.type == KeyPress) {
|
||||||
keysym = XkbKeycodeToKeysym(dpy, e.xkey.keycode, 0, e.xkey.state & ShiftMask?1:0);
|
keysym = W_KeycodeToKeysym(dpy, e.xkey.keycode, e.xkey.state & ShiftMask?1:0);
|
||||||
#ifdef HAVE_PTHREAD
|
#ifdef HAVE_PTHREAD
|
||||||
if (keysym != XK_Right)
|
if (keysym != XK_Right)
|
||||||
diaporama_flag = False;
|
diaporama_flag = False;
|
||||||
|
|||||||
Reference in New Issue
Block a user