mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
added icon tile hint
other stuff
This commit is contained in:
@@ -70,7 +70,6 @@ GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
INTLIBS = @INTLIBS@
|
||||
LD = @LD@
|
||||
LIBPL = @LIBPL@
|
||||
LIBRARY_SEARCH_PATH = @LIBRARY_SEARCH_PATH@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
@@ -80,7 +79,6 @@ MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
NETLIBS = @NETLIBS@
|
||||
NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
@@ -92,6 +90,7 @@ XLFLAGS = @XLFLAGS@
|
||||
XLIBS = @XLIBS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBRARY_PATH = @X_LIBRARY_PATH@
|
||||
supported_locales = @supported_locales@
|
||||
wprefsdir = @wprefsdir@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
@@ -399,10 +399,6 @@ typedef struct WPreferences {
|
||||
char appicon_balloon;
|
||||
char help_balloon;
|
||||
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
|
||||
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */
|
||||
#endif /* WEENDOZE_CYCLE */
|
||||
/* some constants */
|
||||
int dblclick_time; /* double click delay time in ms */
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ wUnshadeWindow(WWindow *wwin)
|
||||
+ wwin->frame->bottom_width) {
|
||||
XResizeWindow(dpy, wwin->frame->core->window, w, h);
|
||||
XMoveWindow(dpy, wwin->client_win, 0, y);
|
||||
XSync(dpy, 0);
|
||||
XFlush(dpy);
|
||||
if (SHADE_DELAY > 0)
|
||||
wusleep(SHADE_DELAY*2000L/3);
|
||||
h+=s;
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "actions.h"
|
||||
#include "dock.h"
|
||||
#include "workspace.h"
|
||||
#include "properties.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,6 +87,9 @@ extern WDDomain *WDRootMenu;
|
||||
|
||||
extern int wScreenCount;
|
||||
|
||||
extern Atom _XA_WINDOWMAKER_ICON_SIZE;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_TILE;
|
||||
|
||||
/*
|
||||
extern proplist_t wDomainName;
|
||||
extern proplist_t wAttributeDomainName;
|
||||
@@ -521,14 +525,6 @@ WDefaultEntry optionList[] = {
|
||||
{"DisableBlinking", "NO", NULL,
|
||||
&wPreferences.dont_blink, getBool, NULL
|
||||
},
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
{"WindozeCycling","NO", NULL,
|
||||
&wPreferences.windoze_cycling, getBool, NULL
|
||||
},
|
||||
{"PopupSwitchMenu","YES", NULL,
|
||||
&wPreferences.popup_switchmenu, getBool, NULL
|
||||
},
|
||||
#endif /* WEENDOZE_CYCLE */
|
||||
/* style options */
|
||||
{"MenuStyle", "normal", seMenuStyles,
|
||||
&wPreferences.menu_style, getEnum, setMenuStyle
|
||||
@@ -2486,6 +2482,11 @@ setIconTile(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
||||
|
||||
scr->icon_tile = img;
|
||||
|
||||
|
||||
/* put the icon in the noticeboard hint */
|
||||
PropSetIconTileHint(scr, img);
|
||||
|
||||
|
||||
if (!wPreferences.flags.noclip) {
|
||||
if (scr->clip_tile) {
|
||||
RDestroyImage(scr->clip_tile);
|
||||
|
||||
@@ -1677,7 +1677,7 @@ drawGNUstepLogo(Display *dpy, Drawable d, int width, int height,
|
||||
"implementation of the OpenStep(tm) specification\n"\
|
||||
"which is a object-oriented framework for\n"\
|
||||
"creating advanced graphical, multi-platform\n"\
|
||||
"applications. Aditionally, a development and\n"\
|
||||
"applications. Additionally, a development and\n"\
|
||||
"user desktop enviroment will be created on top\n"\
|
||||
"of the framework. For more information about\n"\
|
||||
"GNUstep, please visit: www.gnustep.org"
|
||||
|
||||
20
src/dock.c
20
src/dock.c
@@ -3441,6 +3441,13 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
wMenuRealize(dock->menu);
|
||||
}
|
||||
|
||||
|
||||
if (aicon->icon->owner) {
|
||||
wapp = wApplicationOf(aicon->icon->owner->main_window);
|
||||
} else {
|
||||
wapp = NULL;
|
||||
}
|
||||
|
||||
/* launch */
|
||||
entry = dock->menu->entries[++index];
|
||||
entry->clientdata = aicon;
|
||||
@@ -3449,17 +3456,18 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event)
|
||||
/* unhide here */
|
||||
entry = dock->menu->entries[++index];
|
||||
entry->clientdata = aicon;
|
||||
if (wapp && wapp->flags.hidden) {
|
||||
entry->text = _("Unhide Here");
|
||||
} else {
|
||||
entry->text = _("Bring Here");
|
||||
}
|
||||
wMenuSetEnabled(dock->menu, index, appIsRunning);
|
||||
|
||||
/* hide */
|
||||
entry = dock->menu->entries[++index];
|
||||
entry->clientdata = aicon;
|
||||
if (aicon->icon->owner) {
|
||||
wapp = wApplicationOf(aicon->icon->owner->main_window);
|
||||
if (wapp && wapp->flags.hidden)
|
||||
entry->text = _("Unhide");
|
||||
else
|
||||
entry->text = _("Hide");
|
||||
if (wapp && wapp->flags.hidden) {
|
||||
entry->text = _("Unhide");
|
||||
} else {
|
||||
entry->text = _("Hide");
|
||||
}
|
||||
|
||||
@@ -293,7 +293,10 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
|
||||
font = WMBoldSystemFontOfSize(scr->wmscreen, 14);
|
||||
WMSetLabelFont(panel->nameLabel, font);
|
||||
WMReleaseFont(font);
|
||||
WMSetLabelText(panel->nameLabel, aicon->wm_class);
|
||||
if (aicon->wm_class && strcmp(aicon->wm_class, "DockApp")==0)
|
||||
WMSetLabelText(panel->nameLabel, aicon->wm_instance);
|
||||
else
|
||||
WMSetLabelText(panel->nameLabel, aicon->wm_class);
|
||||
|
||||
panel->autoLaunchBtn = WMCreateSwitchButton(panel->win);
|
||||
WMResizeWidget(panel->autoLaunchBtn, PWIDTH-30, 20);
|
||||
|
||||
175
src/event.c
175
src/event.c
@@ -592,7 +592,6 @@ handleExpose(XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* bindable */
|
||||
static void
|
||||
handleButtonPress(XEvent *event)
|
||||
@@ -611,7 +610,6 @@ handleButtonPress(XEvent *event)
|
||||
|
||||
#ifndef LITE
|
||||
if (event->xbutton.window==scr->root_win) {
|
||||
|
||||
if (event->xbutton.button==wPreferences.menu_button) {
|
||||
OpenRootMenu(scr, event->xbutton.x_root,
|
||||
event->xbutton.y_root, False);
|
||||
@@ -1272,67 +1270,6 @@ windowUnderPointer(WScreen *scr)
|
||||
}
|
||||
|
||||
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
|
||||
static WWindow*
|
||||
nextToFocusAfter(WWindow *wwin)
|
||||
{
|
||||
WWindow *tmp = wwin->prev;
|
||||
|
||||
while (tmp) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
|
||||
tmp = wwin;
|
||||
/* start over from the beginning of the list */
|
||||
while (tmp->next)
|
||||
tmp = tmp->next;
|
||||
|
||||
while (tmp && tmp != wwin) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
|
||||
return wwin;
|
||||
}
|
||||
|
||||
|
||||
static WWindow*
|
||||
nextToFocusBefore(WWindow *wwin)
|
||||
{
|
||||
WWindow *tmp = wwin->next;
|
||||
|
||||
while (tmp) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
/* start over from the beginning of the list */
|
||||
tmp = wwin;
|
||||
while (tmp->prev)
|
||||
tmp = tmp->prev;
|
||||
|
||||
while (tmp && tmp != wwin) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return wwin;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
@@ -1356,30 +1293,32 @@ doWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
CurrentTime);
|
||||
|
||||
if (next) {
|
||||
newFocused = nextToFocusAfter(wwin);
|
||||
newFocused = NextToFocusAfter(wwin);
|
||||
} else {
|
||||
newFocused = nextToFocusBefore(wwin);
|
||||
newFocused = NextToFocusBefore(wwin);
|
||||
}
|
||||
|
||||
scr->flags.doing_alt_tab = 1;
|
||||
|
||||
|
||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||
wWindowFocus(newFocused, scr->focused_window);
|
||||
oldFocused = newFocused;
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(newFocused->frame->core);
|
||||
|
||||
#if 0
|
||||
if (wPreferences.popup_switchmenu &&
|
||||
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
|
||||
|
||||
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
|
||||
openedSwitchMenu = True;
|
||||
}
|
||||
|
||||
#endif
|
||||
while (!done) {
|
||||
XEvent ev;
|
||||
|
||||
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
|
||||
/* WMNextEvent(dpy, &ev);*/
|
||||
|
||||
if (ev.type != KeyRelease && ev.type != KeyPress) {
|
||||
WMHandleEvent(&ev);
|
||||
continue;
|
||||
@@ -1387,31 +1326,46 @@ doWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
/* ignore CapsLock */
|
||||
modifiers = ev.xkey.state & ValidModMask;
|
||||
|
||||
if (ev.type == KeyPress
|
||||
&& wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
|
||||
if (ev.type == KeyPress) {
|
||||
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
newFocused = NextToFocusAfter(newFocused);
|
||||
wWindowFocus(newFocused, oldFocused);
|
||||
oldFocused = newFocused;
|
||||
|
||||
/* restore order */
|
||||
CommitStacking(scr);
|
||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
|
||||
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
newFocused = NextToFocusBefore(newFocused);
|
||||
wWindowFocus(newFocused, oldFocused);
|
||||
oldFocused = newFocused;
|
||||
|
||||
/* restore order */
|
||||
CommitStacking(scr);
|
||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
|
||||
} else if (wKeyBindings[WKBD_LOWER].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_LOWER].modifier == modifiers) {
|
||||
|
||||
wLowerFrame(newFocused->frame->core);
|
||||
|
||||
} else if (wKeyBindings[WKBD_RAISE].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_RAISE].modifier == modifiers) {
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
newFocused = nextToFocusAfter(newFocused);
|
||||
wWindowFocus(newFocused, oldFocused);
|
||||
oldFocused = newFocused;
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(newFocused->frame->core);
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
|
||||
} else if (ev.type == KeyPress
|
||||
&& wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
|
||||
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
|
||||
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
newFocused = nextToFocusBefore(newFocused);
|
||||
wWindowFocus(newFocused, oldFocused);
|
||||
oldFocused = newFocused;
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(newFocused->frame->core);
|
||||
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
|
||||
}
|
||||
if (ev.type == KeyRelease) {
|
||||
}
|
||||
} else if (ev.type == KeyRelease) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= 8 * keymap->max_keypermod; i++) {
|
||||
@@ -1426,17 +1380,21 @@ doWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
}
|
||||
XFree(keymap);
|
||||
|
||||
/* restore order */
|
||||
CommitStacking(scr);
|
||||
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
wSetFocusTo(scr, newFocused);
|
||||
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(newFocused->frame->core);
|
||||
|
||||
scr->flags.doing_alt_tab = 0;
|
||||
if (openedSwitchMenu)
|
||||
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
|
||||
}
|
||||
|
||||
|
||||
#endif /* WEENDOZE_CYCLE */
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
@@ -1466,6 +1424,7 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (command < 0) {
|
||||
#ifdef LITE
|
||||
{
|
||||
@@ -1608,35 +1567,11 @@ handleKeyPress(XEvent *event)
|
||||
}
|
||||
break;
|
||||
case WKBD_FOCUSNEXT:
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
if (wPreferences.windoze_cycling) {
|
||||
doWindozeCycle(wwin, event, True);
|
||||
} else
|
||||
#endif /* WEENDOZE_CYCLE */
|
||||
{
|
||||
wwin = NextFocusWindow(scr);
|
||||
if (wwin != NULL) {
|
||||
wSetFocusTo(scr, wwin);
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
}
|
||||
}
|
||||
doWindozeCycle(wwin, event, True);
|
||||
break;
|
||||
|
||||
case WKBD_FOCUSPREV:
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
if (wPreferences.windoze_cycling) {
|
||||
doWindozeCycle(wwin, event, False);
|
||||
} else
|
||||
#endif /* WEENDOZE_CYCLE */
|
||||
{
|
||||
wwin = PrevFocusWindow(scr);
|
||||
if (wwin != NULL) {
|
||||
wSetFocusTo(scr, wwin);
|
||||
if (wPreferences.circ_raise)
|
||||
wRaiseFrame(wwin->frame->core);
|
||||
}
|
||||
}
|
||||
doWindozeCycle(wwin, event, False);
|
||||
break;
|
||||
|
||||
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
|
||||
|
||||
@@ -106,8 +106,8 @@ void StartLogShell(WScreen *scr);
|
||||
|
||||
Bool IsDoubleClick(WScreen *scr, XEvent *event);
|
||||
|
||||
WWindow *NextFocusWindow(WScreen *scr);
|
||||
WWindow *PrevFocusWindow(WScreen *scr);
|
||||
WWindow *NextToFocusAfter(WWindow *wwin);
|
||||
WWindow *NextToFocusBefore(WWindow *wwin);
|
||||
|
||||
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
|
||||
|
||||
|
||||
@@ -110,6 +110,10 @@ Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
Atom _XA_WINDOWMAKER_COMMAND;
|
||||
|
||||
Atom _XA_WINDOWMAKER_ICON_SIZE;
|
||||
Atom _XA_WINDOWMAKER_ICON_TILE;
|
||||
|
||||
|
||||
#ifdef OFFIX_DND
|
||||
Atom _XA_DND_PROTOCOL;
|
||||
Atom _XA_DND_SELECTION;
|
||||
|
||||
91
src/misc.c
91
src/misc.c
@@ -200,69 +200,64 @@ MakeCPPArgs(char *path)
|
||||
#endif /* USECPP */
|
||||
|
||||
|
||||
WWindow*
|
||||
NextFocusWindow(WScreen *scr)
|
||||
{
|
||||
WWindow *tmp, *wwin, *closest, *min;
|
||||
Window d;
|
||||
|
||||
if (!(wwin = scr->focused_window))
|
||||
return NULL;
|
||||
tmp = wwin->prev;
|
||||
closest = NULL;
|
||||
min = wwin;
|
||||
d = 0xffffffff;
|
||||
|
||||
|
||||
WWindow*
|
||||
NextToFocusAfter(WWindow *wwin)
|
||||
{
|
||||
WWindow *tmp = wwin->prev;
|
||||
|
||||
while (tmp) {
|
||||
if (wWindowCanReceiveFocus(tmp)
|
||||
&& (!WFLAGP(tmp, skip_window_list)|| tmp->flags.internal_window)) {
|
||||
if (min->client_win > tmp->client_win)
|
||||
min = tmp;
|
||||
if (tmp->client_win > wwin->client_win
|
||||
&& (!closest
|
||||
|| (tmp->client_win - wwin->client_win) < d)) {
|
||||
closest = tmp;
|
||||
d = tmp->client_win - wwin->client_win;
|
||||
}
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
if (!closest||closest==wwin)
|
||||
return min;
|
||||
return closest;
|
||||
|
||||
tmp = wwin;
|
||||
/* start over from the beginning of the list */
|
||||
while (tmp->next)
|
||||
tmp = tmp->next;
|
||||
|
||||
while (tmp && tmp != wwin) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
|
||||
return wwin;
|
||||
}
|
||||
|
||||
|
||||
WWindow*
|
||||
PrevFocusWindow(WScreen *scr)
|
||||
NextToFocusBefore(WWindow *wwin)
|
||||
{
|
||||
WWindow *tmp, *wwin, *closest, *max;
|
||||
Window d;
|
||||
WWindow *tmp = wwin->next;
|
||||
|
||||
if (!(wwin = scr->focused_window))
|
||||
return NULL;
|
||||
tmp = wwin->prev;
|
||||
closest = NULL;
|
||||
max = wwin;
|
||||
d = 0xffffffff;
|
||||
while (tmp) {
|
||||
if (wWindowCanReceiveFocus(tmp) &&
|
||||
(!WFLAGP(tmp, skip_window_list) || tmp->flags.internal_window)) {
|
||||
if (max->client_win < tmp->client_win)
|
||||
max = tmp;
|
||||
if (tmp->client_win < wwin->client_win
|
||||
&& (!closest
|
||||
|| (wwin->client_win - tmp->client_win) < d)) {
|
||||
closest = tmp;
|
||||
d = wwin->client_win - tmp->client_win;
|
||||
}
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->prev;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
if (!closest||closest==wwin)
|
||||
return max;
|
||||
return closest;
|
||||
}
|
||||
|
||||
/* start over from the beginning of the list */
|
||||
tmp = wwin;
|
||||
while (tmp->prev)
|
||||
tmp = tmp->prev;
|
||||
|
||||
while (tmp && tmp != wwin) {
|
||||
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
|
||||
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return wwin;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -53,6 +53,8 @@ extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_MENU;
|
||||
extern Atom _XA_WINDOWMAKER_WM_PROTOCOLS;
|
||||
extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_TILE;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_SIZE;
|
||||
|
||||
int
|
||||
PropGetNormalHints(Window window, XSizeHints *size_hints, int *pre_iccm)
|
||||
@@ -200,6 +202,59 @@ PropSetWMakerProtocols(Window root)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PropSetIconTileHint(WScreen *scr, RImage *image)
|
||||
{
|
||||
static Atom imageAtom = 0;
|
||||
unsigned char *tmp;
|
||||
int x, y;
|
||||
|
||||
if (scr->info_window == None)
|
||||
return;
|
||||
|
||||
if (!imageAtom) {
|
||||
/*
|
||||
* WIDTH, HEIGHT (16 bits, MSB First)
|
||||
* array of R,G,B,A bytes
|
||||
*/
|
||||
imageAtom = XInternAtom(dpy, "_RGBA_IMAGE", False);
|
||||
}
|
||||
|
||||
tmp = malloc(image->width * image->height * 4 + 4);
|
||||
if (!tmp) {
|
||||
wwarning("could not allocate memory to set _WINDOWMAKER_ICON_TILE hint");
|
||||
return;
|
||||
}
|
||||
|
||||
tmp[0] = image->width>>8;
|
||||
tmp[1] = image->width&0xff;
|
||||
tmp[2] = image->height>>8;
|
||||
tmp[3] = image->height&0xff;
|
||||
|
||||
if (image->format == RRGBAFormat) {
|
||||
memcpy(image->data, &tmp[4], image->width*image->height*4);
|
||||
} else {
|
||||
char *ptr = tmp+4;
|
||||
char *src = image->data;
|
||||
|
||||
for (y = 0; y < image->height; y++) {
|
||||
for (x = 0; x < image->width; x++) {
|
||||
*ptr++ = *src++;
|
||||
*ptr++ = *src++;
|
||||
*ptr++ = *src++;
|
||||
*ptr++ = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XChangeProperty(dpy, scr->info_window, _XA_WINDOWMAKER_ICON_TILE,
|
||||
imageAtom, 8, PropModeReplace, tmp,
|
||||
image->width * image->height * 4 + 4);
|
||||
free(tmp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Window
|
||||
PropGetClientLeader(Window window)
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@ void PropWriteGNUstepWMAttr(Window window, GNUstepWMAttributes *attr);
|
||||
|
||||
void PropSetWMakerProtocols(Window root);
|
||||
void PropCleanUp(Window root);
|
||||
void PropSetIconTileHint(WScreen *scr, RImage *image);
|
||||
|
||||
Window PropGetClientLeader(Window window);
|
||||
|
||||
|
||||
15
src/screen.c
15
src/screen.c
@@ -551,13 +551,6 @@ createInternalWindows(WScreen *scr)
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, scr->w_depth,
|
||||
CopyFromParent, scr->w_visual, vmask, &attribs);
|
||||
|
||||
|
||||
/* for our window manager info notice board */
|
||||
scr->info_window =
|
||||
XCreateWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, CopyFromParent,
|
||||
CopyFromParent, CopyFromParent, CWOverrideRedirect,
|
||||
&attribs);
|
||||
|
||||
/*
|
||||
* If the window is clicked without having ButtonPress selected, the
|
||||
* resulting event will have event.xbutton.window == root.
|
||||
@@ -799,6 +792,13 @@ wScreenInit(int screen_number)
|
||||
/* create GCs with default values */
|
||||
allocGCs(scr);
|
||||
|
||||
|
||||
/* for our window manager info notice board. Need to
|
||||
* create before reading the defaults, because it will be used there.
|
||||
*/
|
||||
scr->info_window = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 10, 10,
|
||||
0, 0, 0);
|
||||
|
||||
/* read defaults for this screen */
|
||||
wReadDefaults(scr, WDWindowMaker->dictionary);
|
||||
|
||||
@@ -856,7 +856,6 @@ wScreenInit(int screen_number)
|
||||
|
||||
wScreenUpdateUsableArea(scr);
|
||||
|
||||
|
||||
return scr;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ typedef struct _WScreen {
|
||||
/* some client has issued a WM_COLORMAP_NOTIFY */
|
||||
unsigned int colormap_stuff_blocked:1;
|
||||
unsigned int doing_alt_tab:1;
|
||||
unsigned int jump_back_pending:1;
|
||||
unsigned int jump_back_pending:1;
|
||||
#ifdef KWM_HINTS
|
||||
unsigned int kwm_syncing_name:1;
|
||||
unsigned int kwm_syncing_count:1;
|
||||
|
||||
@@ -126,6 +126,8 @@ extern Atom _XA_WINDOWMAKER_STATE;
|
||||
extern Atom _XA_WINDOWMAKER_WM_FUNCTION;
|
||||
extern Atom _XA_WINDOWMAKER_NOTICEBOARD;
|
||||
extern Atom _XA_WINDOWMAKER_COMMAND;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_SIZE;
|
||||
extern Atom _XA_WINDOWMAKER_ICON_TILE;
|
||||
|
||||
extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
|
||||
|
||||
@@ -643,7 +645,9 @@ static char *atomNames[] = {
|
||||
GNUSTEP_WM_MINIATURIZE_WINDOW,
|
||||
"_WINDOWMAKER_WM_FUNCTION",
|
||||
"_WINDOWMAKER_NOTICEBOARD",
|
||||
"_WINDOWMAKER_COMMAND"
|
||||
"_WINDOWMAKER_COMMAND",
|
||||
"_WINDOWMAKER_ICON_SIZE",
|
||||
"_WINDOWMAKER_ICON_TILE"
|
||||
};
|
||||
|
||||
|
||||
@@ -713,6 +717,8 @@ StartUp(Bool defaultScreenOnly)
|
||||
|
||||
_XA_WINDOWMAKER_COMMAND = atom[16];
|
||||
|
||||
_XA_WINDOWMAKER_ICON_SIZE = atom[17];
|
||||
_XA_WINDOWMAKER_ICON_TILE = atom[18];
|
||||
|
||||
#ifdef OFFIX_DND
|
||||
_XA_DND_SELECTION = XInternAtom(dpy, "DndSelection", False);
|
||||
|
||||
@@ -49,14 +49,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* #define to enable WindozeCycling. Set WindozeCycling = YES in
|
||||
* your WindowMaker config file
|
||||
* WARNING: this still has some bugs
|
||||
*/
|
||||
#undef WEENDOZE_CYCLE
|
||||
|
||||
|
||||
/* undefine ANIMATIONS if you don't want animations for iconification,
|
||||
* shading, icon arrangement etc. */
|
||||
#define ANIMATIONS
|
||||
|
||||
@@ -248,6 +248,8 @@ typedef struct WWindow {
|
||||
#endif
|
||||
|
||||
/* info flags */
|
||||
unsigned int is_gnustep:1;
|
||||
|
||||
unsigned int buttons_dont_fit:1;
|
||||
unsigned int rebuild_texture:1;/* the window was resized and
|
||||
* gradients should be re-rendered */
|
||||
|
||||
Reference in New Issue
Block a user