mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Coding style cleanups
This commit is contained in:
committed by
Carlos R. Mafra
parent
e819818eeb
commit
4f4ea569a0
@@ -75,23 +75,23 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char *command, char *wm_instance,
|
|||||||
|
|
||||||
dicon->prev = NULL;
|
dicon->prev = NULL;
|
||||||
dicon->next = scr->app_icon_list;
|
dicon->next = scr->app_icon_list;
|
||||||
if (scr->app_icon_list) {
|
if (scr->app_icon_list)
|
||||||
scr->app_icon_list->prev = dicon;
|
scr->app_icon_list->prev = dicon;
|
||||||
}
|
|
||||||
scr->app_icon_list = dicon;
|
scr->app_icon_list = dicon;
|
||||||
|
|
||||||
if (command) {
|
if (command)
|
||||||
dicon->command = wstrdup(command);
|
dicon->command = wstrdup(command);
|
||||||
}
|
|
||||||
if (wm_class)
|
if (wm_class)
|
||||||
dicon->wm_class = wstrdup(wm_class);
|
dicon->wm_class = wstrdup(wm_class);
|
||||||
|
|
||||||
if (wm_instance)
|
if (wm_instance)
|
||||||
dicon->wm_instance = wstrdup(wm_instance);
|
dicon->wm_instance = wstrdup(wm_instance);
|
||||||
|
|
||||||
path = wDefaultGetIconFile(scr, wm_instance, wm_class, True);
|
path = wDefaultGetIconFile(scr, wm_instance, wm_class, True);
|
||||||
if (!path && command) {
|
if (!path && command) {
|
||||||
wApplicationExtractDirPackIcon(scr, command, wm_instance, wm_class);
|
wApplicationExtractDirPackIcon(scr, command, wm_instance, wm_class);
|
||||||
|
|
||||||
path = wDefaultGetIconFile(scr, wm_instance, wm_class, False);
|
path = wDefaultGetIconFile(scr, wm_instance, wm_class, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,13 +129,14 @@ WAppIcon *wAppIconCreate(WWindow * leader_win)
|
|||||||
|
|
||||||
aicon->prev = NULL;
|
aicon->prev = NULL;
|
||||||
aicon->next = scr->app_icon_list;
|
aicon->next = scr->app_icon_list;
|
||||||
if (scr->app_icon_list) {
|
if (scr->app_icon_list)
|
||||||
scr->app_icon_list->prev = aicon;
|
scr->app_icon_list->prev = aicon;
|
||||||
}
|
|
||||||
scr->app_icon_list = aicon;
|
scr->app_icon_list = aicon;
|
||||||
|
|
||||||
if (leader_win->wm_class)
|
if (leader_win->wm_class)
|
||||||
aicon->wm_class = wstrdup(leader_win->wm_class);
|
aicon->wm_class = wstrdup(leader_win->wm_class);
|
||||||
|
|
||||||
if (leader_win->wm_instance)
|
if (leader_win->wm_instance)
|
||||||
aicon->wm_instance = wstrdup(leader_win->wm_instance);
|
aicon->wm_instance = wstrdup(leader_win->wm_instance);
|
||||||
|
|
||||||
@@ -170,6 +171,7 @@ void wAppIconDestroy(WAppIcon * aicon)
|
|||||||
#endif
|
#endif
|
||||||
if (aicon->wm_instance)
|
if (aicon->wm_instance)
|
||||||
wfree(aicon->wm_instance);
|
wfree(aicon->wm_instance);
|
||||||
|
|
||||||
if (aicon->wm_class)
|
if (aicon->wm_class)
|
||||||
wfree(aicon->wm_class);
|
wfree(aicon->wm_class);
|
||||||
|
|
||||||
@@ -203,11 +205,6 @@ static void drawCorner(WIcon * icon)
|
|||||||
points, 3, Convex, CoordModeOrigin);
|
points, 3, Convex, CoordModeOrigin);
|
||||||
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 0, 12);
|
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 0, 12);
|
||||||
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 12, 0);
|
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 12, 0);
|
||||||
/* drawing the second line gives a weird concave look. -Dan */
|
|
||||||
#if 0
|
|
||||||
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 1, 1, 1, 11);
|
|
||||||
XDrawLine(dpy, icon->core->window, scr->icon_title_texture->light_gc, 1, 1, 11, 1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wAppIconMove(WAppIcon * aicon, int x, int y)
|
void wAppIconMove(WAppIcon * aicon, int x, int y)
|
||||||
@@ -275,11 +272,10 @@ void wAppIconPaint(WAppIcon * aicon)
|
|||||||
drawCorner(aicon->icon);
|
drawCorner(aicon->icon);
|
||||||
|
|
||||||
XSetClipMask(dpy, scr->copy_gc, None);
|
XSetClipMask(dpy, scr->copy_gc, None);
|
||||||
if (aicon->launching) {
|
if (aicon->launching)
|
||||||
XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc,
|
XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc,
|
||||||
0, 0, wPreferences.icon_size, wPreferences.icon_size);
|
0, 0, wPreferences.icon_size, wPreferences.icon_size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Bool wAppIconSave(WAppIcon *aicon)
|
Bool wAppIconSave(WAppIcon *aicon)
|
||||||
{
|
{
|
||||||
@@ -329,6 +325,7 @@ static void setIconCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
if (icon->editing)
|
if (icon->editing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
icon->editing = 1;
|
icon->editing = 1;
|
||||||
scr = icon->icon->core->screen_ptr;
|
scr = icon->icon->core->screen_ptr;
|
||||||
|
|
||||||
@@ -388,9 +385,8 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
wwin = wapp->main_window_desc->screen_ptr->focused_window;
|
wwin = wapp->main_window_desc->screen_ptr->focused_window;
|
||||||
while (wwin) {
|
while (wwin) {
|
||||||
twin = wwin->prev;
|
twin = wwin->prev;
|
||||||
if (wwin->fake_group == fPtr) {
|
if (wwin->fake_group == fPtr)
|
||||||
wClientKill(wwin);
|
wClientKill(wwin);
|
||||||
}
|
|
||||||
wwin = twin;
|
wwin = twin;
|
||||||
}
|
}
|
||||||
} else if (!wapp->main_window_desc->flags.destroyed) {
|
} else if (!wapp->main_window_desc->flags.destroyed) {
|
||||||
@@ -398,9 +394,7 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wrelease(wapp->main_window_desc);
|
wrelease(wapp->main_window_desc);
|
||||||
|
|
||||||
wfree(buffer);
|
wfree(buffer);
|
||||||
|
|
||||||
WCHANGE_STATE(WSTATE_NORMAL);
|
WCHANGE_STATE(WSTATE_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,11 +424,10 @@ static void openApplicationMenu(WApplication * wapp, int x, int y)
|
|||||||
|
|
||||||
menu = scr->icon_menu;
|
menu = scr->icon_menu;
|
||||||
|
|
||||||
if (wapp->flags.hidden) {
|
if (wapp->flags.hidden)
|
||||||
menu->entries[1]->text = _("Unhide");
|
menu->entries[1]->text = _("Unhide");
|
||||||
} else {
|
else
|
||||||
menu->entries[1]->text = _("Hide");
|
menu->entries[1]->text = _("Hide");
|
||||||
}
|
|
||||||
|
|
||||||
menu->flags.realized = 0;
|
menu->flags.realized = 0;
|
||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
@@ -442,13 +435,14 @@ static void openApplicationMenu(WApplication * wapp, int x, int y)
|
|||||||
x -= menu->frame->core->width / 2;
|
x -= menu->frame->core->width / 2;
|
||||||
if (x + menu->frame->core->width > scr->scr_width)
|
if (x + menu->frame->core->width > scr->scr_width)
|
||||||
x = scr->scr_width - menu->frame->core->width;
|
x = scr->scr_width - menu->frame->core->width;
|
||||||
|
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
/* set client data */
|
/* set client data */
|
||||||
for (i = 0; i < menu->entry_no; i++) {
|
for (i = 0; i < menu->entry_no; i++)
|
||||||
menu->entries[i]->clientdata = wapp;
|
menu->entries[i]->clientdata = wapp;
|
||||||
}
|
|
||||||
wMenuMapAt(menu, x, y, False);
|
wMenuMapAt(menu, x, y, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,10 +471,9 @@ static void iconDblClick(WObjDescriptor * desc, XEvent * event)
|
|||||||
|
|
||||||
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
||||||
|
|
||||||
if (event->xbutton.state & MOD_MASK) {
|
if (event->xbutton.state & MOD_MASK)
|
||||||
wHideOtherApplications(aicon->icon->owner);
|
wHideOtherApplications(aicon->icon->owner);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
||||||
{
|
{
|
||||||
@@ -543,9 +536,8 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
|
|
||||||
if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask
|
if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask
|
||||||
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
|
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
|
||||||
GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
|
GrabModeAsync, None, None, CurrentTime) != GrabSuccess)
|
||||||
wwarning("pointer grab failed for appicon move");
|
wwarning("pointer grab failed for appicon move");
|
||||||
}
|
|
||||||
|
|
||||||
if (wPreferences.flags.nodock && wPreferences.flags.noclip)
|
if (wPreferences.flags.nodock && wPreferences.flags.noclip)
|
||||||
dockable = 0;
|
dockable = 0;
|
||||||
@@ -595,11 +587,10 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
x = ev.xmotion.x_root - dx;
|
x = ev.xmotion.x_root - dx;
|
||||||
y = ev.xmotion.y_root - dy;
|
y = ev.xmotion.y_root - dy;
|
||||||
|
|
||||||
if (movingSingle) {
|
if (movingSingle)
|
||||||
XMoveWindow(dpy, icon->core->window, x, y);
|
XMoveWindow(dpy, icon->core->window, x, y);
|
||||||
} else {
|
else
|
||||||
wAppIconMove(aicon, x, y);
|
wAppIconMove(aicon, x, y);
|
||||||
}
|
|
||||||
|
|
||||||
if (dockable) {
|
if (dockable) {
|
||||||
if (scr->dock && wDockSnapIcon(scr->dock, aicon, x, y, &ix, &iy, False)) {
|
if (scr->dock && wDockSnapIcon(scr->dock, aicon, x, y, &ix, &iy, False)) {
|
||||||
@@ -622,9 +613,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
scr->last_dock = scr->dock;
|
scr->last_dock = scr->dock;
|
||||||
|
|
||||||
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
|
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
|
||||||
if (!docking) {
|
if (!docking)
|
||||||
XMapWindow(dpy, scr->dock_shadow);
|
XMapWindow(dpy, scr->dock_shadow);
|
||||||
}
|
|
||||||
docking = 1;
|
docking = 1;
|
||||||
} else if (workspace->clip &&
|
} else if (workspace->clip &&
|
||||||
wDockSnapIcon(workspace->clip, aicon, x, y, &ix, &iy, False)) {
|
wDockSnapIcon(workspace->clip, aicon, x, y, &ix, &iy, False)) {
|
||||||
@@ -647,16 +638,15 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
scr->last_dock = workspace->clip;
|
scr->last_dock = workspace->clip;
|
||||||
|
|
||||||
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
|
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
|
||||||
if (!docking) {
|
if (!docking)
|
||||||
XMapWindow(dpy, scr->dock_shadow);
|
XMapWindow(dpy, scr->dock_shadow);
|
||||||
}
|
|
||||||
docking = 1;
|
docking = 1;
|
||||||
} else if (docking) {
|
} else if (docking) {
|
||||||
XUnmapWindow(dpy, scr->dock_shadow);
|
XUnmapWindow(dpy, scr->dock_shadow);
|
||||||
docking = 0;
|
docking = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
@@ -674,9 +664,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
|
|||||||
SlideWindow(icon->core->window, x, y, shad_x, shad_y);
|
SlideWindow(icon->core->window, x, y, shad_x, shad_y);
|
||||||
XUnmapWindow(dpy, scr->dock_shadow);
|
XUnmapWindow(dpy, scr->dock_shadow);
|
||||||
docked = wDockAttachIcon(scr->last_dock, aicon, ix, iy);
|
docked = wDockAttachIcon(scr->last_dock, aicon, ix, iy);
|
||||||
if (scr->last_dock->auto_collapse) {
|
if (scr->last_dock->auto_collapse)
|
||||||
collapsed = 0;
|
collapsed = 0;
|
||||||
}
|
|
||||||
if (workspace->clip &&
|
if (workspace->clip &&
|
||||||
workspace->clip != scr->last_dock && workspace->clip->auto_raise_lower)
|
workspace->clip != scr->last_dock && workspace->clip->auto_raise_lower)
|
||||||
wDockLower(workspace->clip);
|
wDockLower(workspace->clip);
|
||||||
|
|||||||
@@ -28,17 +28,11 @@ typedef struct WApplication {
|
|||||||
struct WApplication *prev;
|
struct WApplication *prev;
|
||||||
|
|
||||||
Window main_window; /* ID of the group leader */
|
Window main_window; /* ID of the group leader */
|
||||||
|
|
||||||
struct WWindow *main_window_desc; /* main (leader) window descriptor */
|
struct WWindow *main_window_desc; /* main (leader) window descriptor */
|
||||||
|
|
||||||
WMenu *menu; /* application menu */
|
WMenu *menu; /* application menu */
|
||||||
|
|
||||||
struct WAppIcon *app_icon;
|
struct WAppIcon *app_icon;
|
||||||
|
|
||||||
int refcount;
|
int refcount;
|
||||||
|
|
||||||
struct WWindow *last_focused; /* focused window before hide */
|
struct WWindow *last_focused; /* focused window before hide */
|
||||||
|
|
||||||
int last_workspace; /* last workspace used to work on the
|
int last_workspace; /* last workspace used to work on the
|
||||||
* app */
|
* app */
|
||||||
WMHandlerID *urgent_bounce_timer;
|
WMHandlerID *urgent_bounce_timer;
|
||||||
@@ -52,10 +46,8 @@ typedef struct WApplication {
|
|||||||
|
|
||||||
|
|
||||||
WApplication *wApplicationCreate(struct WWindow *wwin);
|
WApplication *wApplicationCreate(struct WWindow *wwin);
|
||||||
void wApplicationDestroy(WApplication *wapp);
|
|
||||||
|
|
||||||
WApplication *wApplicationOf(Window window);
|
WApplication *wApplicationOf(Window window);
|
||||||
|
void wApplicationDestroy(WApplication *wapp);
|
||||||
void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance,
|
void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance,
|
||||||
char *wm_class);
|
char *wm_class);
|
||||||
void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance,
|
void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance,
|
||||||
|
|||||||
200
src/window.c
200
src/window.c
@@ -123,14 +123,13 @@ static void appearanceObserver(void *self, WMNotification * notif)
|
|||||||
wWindowConfigureBorders(wwin);
|
wWindowConfigureBorders(wwin);
|
||||||
if (wwin->flags.shaded) {
|
if (wwin->flags.shaded) {
|
||||||
wFrameWindowResize(wwin->frame, wwin->frame->core->width, wwin->frame->top_width - 1);
|
wFrameWindowResize(wwin->frame, wwin->frame->core->width, wwin->frame->top_width - 1);
|
||||||
|
|
||||||
wwin->client.y = wwin->frame_y - wwin->client.height + wwin->frame->top_width;
|
wwin->client.y = wwin->frame_y - wwin->client.height + wwin->frame->top_width;
|
||||||
wWindowSynthConfigureNotify(wwin);
|
wWindowSynthConfigureNotify(wwin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags & WTextureSettings) {
|
if (flags & WTextureSettings)
|
||||||
wwin->frame->flags.need_texture_remake = 1;
|
wwin->frame->flags.need_texture_remake = 1;
|
||||||
}
|
|
||||||
if (flags & (WTextureSettings | WColorSettings)) {
|
if (flags & (WTextureSettings | WColorSettings)) {
|
||||||
if (wwin->frame->titlebar)
|
if (wwin->frame->titlebar)
|
||||||
XClearWindow(dpy, wwin->frame->titlebar->window);
|
XClearWindow(dpy, wwin->frame->titlebar->window);
|
||||||
@@ -480,13 +479,11 @@ static void fixLeaderProperties(WWindow *wwin)
|
|||||||
|
|
||||||
if (haveCommand) {
|
if (haveCommand) {
|
||||||
command = GetCommandForWindow(wwin->client_win);
|
command = GetCommandForWindow(wwin->client_win);
|
||||||
if (command) {
|
if (command)
|
||||||
/* command already set. nothing to do. */
|
wfree(command); /* command already set. nothing to do. */
|
||||||
wfree(command);
|
else
|
||||||
} else {
|
|
||||||
XSetCommand(dpy, wwin->client_win, argv, argc);
|
XSetCommand(dpy, wwin->client_win, argv, argc);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
window = leaders[i];
|
window = leaders[i];
|
||||||
@@ -508,13 +505,11 @@ static void fixLeaderProperties(WWindow *wwin)
|
|||||||
|
|
||||||
if (haveCommand) {
|
if (haveCommand) {
|
||||||
command = GetCommandForWindow(window);
|
command = GetCommandForWindow(window);
|
||||||
if (command) {
|
if (command)
|
||||||
/* command already set. nothing to do. */
|
wfree(command); /* command already set. nothing to do. */
|
||||||
wfree(command);
|
else
|
||||||
} else {
|
|
||||||
XSetCommand(dpy, window, argv, argc);
|
XSetCommand(dpy, window, argv, argc);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure we get notification when this window is destroyed */
|
/* Make sure we get notification when this window is destroyed */
|
||||||
if (XGetWindowAttributes(dpy, window, &attr))
|
if (XGetWindowAttributes(dpy, window, &attr))
|
||||||
@@ -676,12 +671,11 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
XSetWindowBorderWidth(dpy, window, 0);
|
XSetWindowBorderWidth(dpy, window, 0);
|
||||||
|
|
||||||
/* get hints from GNUstep app */
|
/* get hints from GNUstep app */
|
||||||
if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "GNUstep") == 0) {
|
if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "GNUstep") == 0)
|
||||||
wwin->flags.is_gnustep = 1;
|
wwin->flags.is_gnustep = 1;
|
||||||
}
|
|
||||||
if (!PropGetGNUstepWMAttr(window, &wwin->wm_gnustep_attr)) {
|
if (!PropGetGNUstepWMAttr(window, &wwin->wm_gnustep_attr))
|
||||||
wwin->wm_gnustep_attr = NULL;
|
wwin->wm_gnustep_attr = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "DockApp") == 0) {
|
if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "DockApp") == 0) {
|
||||||
wwin->flags.is_dockapp = 1;
|
wwin->flags.is_dockapp = 1;
|
||||||
@@ -698,11 +692,8 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
if (wwin->wm_hints->flags & StateHint) {
|
if (wwin->wm_hints->flags & StateHint) {
|
||||||
|
|
||||||
if (wwin->wm_hints->initial_state == IconicState) {
|
if (wwin->wm_hints->initial_state == IconicState) {
|
||||||
|
|
||||||
wwin->flags.miniaturized = 1;
|
wwin->flags.miniaturized = 1;
|
||||||
|
|
||||||
} else if (wwin->wm_hints->initial_state == WithdrawnState) {
|
} else if (wwin->wm_hints->initial_state == WithdrawnState) {
|
||||||
|
|
||||||
wwin->flags.is_dockapp = 1;
|
wwin->flags.is_dockapp = 1;
|
||||||
withdraw = True;
|
withdraw = True;
|
||||||
}
|
}
|
||||||
@@ -768,10 +759,9 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
extern Atom _XA_WINDOWMAKER_MENU;
|
extern Atom _XA_WINDOWMAKER_MENU;
|
||||||
XTextProperty text_prop;
|
XTextProperty text_prop;
|
||||||
|
|
||||||
if (XGetTextProperty(dpy, wwin->main_window, &text_prop, _XA_WINDOWMAKER_MENU)) {
|
if (XGetTextProperty(dpy, wwin->main_window, &text_prop, _XA_WINDOWMAKER_MENU))
|
||||||
WSETUFLAG(wwin, shared_appicon, 0);
|
WSETUFLAG(wwin, shared_appicon, 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (wwin->flags.is_dockapp)
|
if (wwin->flags.is_dockapp)
|
||||||
WSETUFLAG(wwin, shared_appicon, 0);
|
WSETUFLAG(wwin, shared_appicon, 0);
|
||||||
@@ -849,13 +839,9 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
|
|
||||||
/* apply previous state if it exists and we're in startup */
|
/* apply previous state if it exists and we're in startup */
|
||||||
if (scr->flags.startup && wm_state >= 0) {
|
if (scr->flags.startup && wm_state >= 0) {
|
||||||
|
|
||||||
if (wm_state == IconicState) {
|
if (wm_state == IconicState) {
|
||||||
|
|
||||||
wwin->flags.miniaturized = 1;
|
wwin->flags.miniaturized = 1;
|
||||||
|
|
||||||
} else if (wm_state == WithdrawnState) {
|
} else if (wm_state == WithdrawnState) {
|
||||||
|
|
||||||
withdraw = True;
|
withdraw = True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -874,9 +860,8 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
if (win_state->state->shaded > 0 && !WFLAGP(wwin, no_shadeable))
|
if (win_state->state->shaded > 0 && !WFLAGP(wwin, no_shadeable))
|
||||||
wwin->flags.shaded = win_state->state->shaded;
|
wwin->flags.shaded = win_state->state->shaded;
|
||||||
|
|
||||||
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 (!IS_OMNIPRESENT(wwin)) {
|
if (!IS_OMNIPRESENT(wwin)) {
|
||||||
int w = wDefaultGetStartWorkspace(scr, wwin->wm_instance,
|
int w = wDefaultGetStartWorkspace(scr, wwin->wm_instance,
|
||||||
@@ -951,29 +936,22 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
|
|
||||||
/* set workspace on which the window starts */
|
/* set workspace on which the window starts */
|
||||||
if (workspace >= 0) {
|
if (workspace >= 0) {
|
||||||
if (workspace > scr->workspace_count - 1) {
|
if (workspace > scr->workspace_count - 1)
|
||||||
workspace = workspace % scr->workspace_count;
|
workspace = workspace % scr->workspace_count;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
w = wDefaultGetStartWorkspace(scr, wwin->wm_instance, wwin->wm_class);
|
w = wDefaultGetStartWorkspace(scr, wwin->wm_instance, wwin->wm_class);
|
||||||
|
|
||||||
if (w >= 0 && w < scr->workspace_count && !(IS_OMNIPRESENT(wwin))) {
|
if (w >= 0 && w < scr->workspace_count && !(IS_OMNIPRESENT(wwin))) {
|
||||||
|
|
||||||
workspace = w;
|
workspace = w;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (wPreferences.open_transients_with_parent && transientOwner) {
|
if (wPreferences.open_transients_with_parent && transientOwner)
|
||||||
|
|
||||||
workspace = transientOwner->frame->workspace;
|
workspace = transientOwner->frame->workspace;
|
||||||
|
else
|
||||||
} else {
|
|
||||||
|
|
||||||
workspace = scr->current_workspace;
|
workspace = scr->current_workspace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* setup window geometry */
|
/* setup window geometry */
|
||||||
if (win_state && win_state->state->w > 0) {
|
if (win_state && win_state->state->w > 0) {
|
||||||
@@ -1202,9 +1180,9 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
* If this is the case, point the leader of this window to
|
* If this is the case, point the leader of this window to
|
||||||
* itself */
|
* itself */
|
||||||
leader = wWindowFor(wwin->main_window);
|
leader = wWindowFor(wwin->main_window);
|
||||||
if (leader && leader->main_window == None) {
|
if (leader && leader->main_window == None)
|
||||||
leader->main_window = leader->client_win;
|
leader->main_window = leader->client_win;
|
||||||
}
|
|
||||||
app = wApplicationCreate(wwin);
|
app = wApplicationCreate(wwin);
|
||||||
if (app) {
|
if (app) {
|
||||||
app->last_workspace = workspace;
|
app->last_workspace = workspace;
|
||||||
@@ -1248,35 +1226,13 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
* WM_STATE set before they get mapped. Else WM_STATE is set later,
|
* WM_STATE set before they get mapped. Else WM_STATE is set later,
|
||||||
* after the return from this function.
|
* after the return from this function.
|
||||||
*/
|
*/
|
||||||
if (wwin->wm_hints && (wwin->wm_hints->flags & StateHint)) {
|
if (wwin->wm_hints && (wwin->wm_hints->flags & StateHint))
|
||||||
wClientSetState(wwin, wwin->wm_hints->initial_state, None);
|
wClientSetState(wwin, wwin->wm_hints->initial_state, None);
|
||||||
} else {
|
else
|
||||||
wClientSetState(wwin, NormalState, None);
|
wClientSetState(wwin, NormalState, None);
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
if (wPreferences.superfluous && !wPreferences.no_animations && !scr->flags.startup &&
|
||||||
/* if not auto focus, then map the window under the currently
|
(wwin->transient_for == None || wwin->transient_for == scr->root_win) &&
|
||||||
* focused window */
|
|
||||||
#define _WIDTH(w) (w)->frame->core->width
|
|
||||||
#define _HEIGHT(w) (w)->frame->core->height
|
|
||||||
if (!wPreferences.auto_focus && scr->focused_window
|
|
||||||
&& !scr->flags.startup && !transientOwner && ((wWindowObscuresWindow(wwin, scr->focused_window)
|
|
||||||
&& (_WIDTH(wwin) >
|
|
||||||
(_WIDTH(scr->focused_window) * 5) / 3
|
|
||||||
|| _HEIGHT(wwin) >
|
|
||||||
(_HEIGHT(scr->focused_window) * 5) / 3)
|
|
||||||
&& WINDOW_LEVEL(scr->focused_window) ==
|
|
||||||
WINDOW_LEVEL(wwin))
|
|
||||||
|| wwin->flags.maximized)) {
|
|
||||||
MoveInStackListUnder(scr->focused_window->frame->core, wwin->frame->core);
|
|
||||||
}
|
|
||||||
#undef _WIDTH
|
|
||||||
#undef _HEIGHT
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (wPreferences.superfluous && !wPreferences.no_animations
|
|
||||||
&& !scr->flags.startup && (wwin->transient_for == None || wwin->transient_for == scr->root_win)
|
|
||||||
/*
|
/*
|
||||||
* The brain damaged idiotic non-click to focus modes will
|
* The brain damaged idiotic non-click to focus modes will
|
||||||
* have trouble with this because:
|
* have trouble with this because:
|
||||||
@@ -1293,19 +1249,17 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
* and when it is processed, the client that owns that window
|
* and when it is processed, the client that owns that window
|
||||||
* will reject the XSetInputFocus() for it.
|
* will reject the XSetInputFocus() for it.
|
||||||
*/
|
*/
|
||||||
&& (wPreferences.focus_mode == WKF_CLICK || wPreferences.auto_focus)) {
|
(wPreferences.focus_mode == WKF_CLICK || wPreferences.auto_focus))
|
||||||
DoWindowBirth(wwin);
|
DoWindowBirth(wwin);
|
||||||
}
|
|
||||||
|
|
||||||
wWindowMap(wwin);
|
wWindowMap(wwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup stacking descriptor */
|
/* setup stacking descriptor */
|
||||||
if (transientOwner) {
|
if (transientOwner)
|
||||||
wwin->frame->core->stacking->child_of = transientOwner->frame->core;
|
wwin->frame->core->stacking->child_of = transientOwner->frame->core;
|
||||||
} else {
|
else
|
||||||
wwin->frame->core->stacking->child_of = NULL;
|
wwin->frame->core->stacking->child_of = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (!scr->focused_window) {
|
if (!scr->focused_window) {
|
||||||
/* first window on the list */
|
/* first window on the list */
|
||||||
@@ -1326,9 +1280,8 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
|
|
||||||
/* raise is set to true if we un-hid the app when this window was born.
|
/* raise is set to true if we un-hid the app when this window was born.
|
||||||
* we raise, else old windows of this app will be above this new one. */
|
* we raise, else old windows of this app will be above this new one. */
|
||||||
if (raise) {
|
if (raise)
|
||||||
wRaiseFrame(wwin->frame->core);
|
wRaiseFrame(wwin->frame->core);
|
||||||
}
|
|
||||||
|
|
||||||
/* Update name must come after WApplication stuff is done */
|
/* Update name must come after WApplication stuff is done */
|
||||||
wWindowUpdateName(wwin, title);
|
wWindowUpdateName(wwin, title);
|
||||||
@@ -1358,15 +1311,13 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
Window dummy;
|
Window dummy;
|
||||||
|
|
||||||
if (XQueryPointer(dpy, scr->root_win, &dummy, &dummy,
|
if (XQueryPointer(dpy, scr->root_win, &dummy, &dummy,
|
||||||
&foo, &foo, &foo, &foo, &bar) != False) {
|
&foo, &foo, &foo, &foo, &bar) != False)
|
||||||
same_screen = 1;
|
same_screen = 1;
|
||||||
}
|
|
||||||
|
|
||||||
if (same_screen == 1 && same_head == 1) {
|
if (same_screen == 1 && same_head == 1)
|
||||||
wSetFocusTo(scr, wwin);
|
wSetFocusTo(scr, wwin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
wWindowResetMouseGrabs(wwin);
|
wWindowResetMouseGrabs(wwin);
|
||||||
|
|
||||||
if (!WFLAGP(wwin, no_bind_keys))
|
if (!WFLAGP(wwin, no_bind_keys))
|
||||||
@@ -1536,14 +1487,12 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
|
|
||||||
/* First close attribute editor window if open */
|
/* First close attribute editor window if open */
|
||||||
if (wwin->flags.inspector_open) {
|
if (wwin->flags.inspector_open)
|
||||||
wCloseInspectorForWindow(wwin);
|
wCloseInspectorForWindow(wwin);
|
||||||
}
|
|
||||||
|
|
||||||
/* Close window menu if it's open for this window */
|
/* Close window menu if it's open for this window */
|
||||||
if (wwin->flags.menu_open_for_me) {
|
if (wwin->flags.menu_open_for_me)
|
||||||
CloseWindowMenu(scr);
|
CloseWindowMenu(scr);
|
||||||
}
|
|
||||||
|
|
||||||
if (!destroyed) {
|
if (!destroyed) {
|
||||||
if (!wwin->flags.internal_window)
|
if (!wwin->flags.internal_window)
|
||||||
@@ -1551,11 +1500,10 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
|
|
||||||
/* If this is a leader window, we still need to listen for
|
/* If this is a leader window, we still need to listen for
|
||||||
* DestroyNotify and PropertyNotify. */
|
* DestroyNotify and PropertyNotify. */
|
||||||
if (wApplicationOf(wwin->client_win)) {
|
if (wApplicationOf(wwin->client_win))
|
||||||
XSelectInput(dpy, wwin->client_win, StructureNotifyMask | PropertyChangeMask);
|
XSelectInput(dpy, wwin->client_win, StructureNotifyMask | PropertyChangeMask);
|
||||||
} else {
|
else
|
||||||
XSelectInput(dpy, wwin->client_win, NoEventMask);
|
XSelectInput(dpy, wwin->client_win, NoEventMask);
|
||||||
}
|
|
||||||
|
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, wwin->client_win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, wwin->client_win);
|
||||||
XUngrabKey(dpy, AnyKey, AnyModifier, wwin->client_win);
|
XUngrabKey(dpy, AnyKey, AnyModifier, wwin->client_win);
|
||||||
@@ -1582,13 +1530,12 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
if (wwin->transient_for != scr->root_win) {
|
if (wwin->transient_for != scr->root_win) {
|
||||||
owner = wWindowFor(wwin->transient_for);
|
owner = wWindowFor(wwin->transient_for);
|
||||||
if (owner) {
|
if (owner) {
|
||||||
if (!owner->flags.semi_focused) {
|
if (!owner->flags.semi_focused)
|
||||||
owner = NULL;
|
owner = NULL;
|
||||||
} else {
|
else
|
||||||
owner->flags.semi_focused = 0;
|
owner->flags.semi_focused = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
wasFocused = wwin->flags.focused;
|
wasFocused = wwin->flags.focused;
|
||||||
|
|
||||||
@@ -1602,6 +1549,7 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
|
|
||||||
if (wwin->prev)
|
if (wwin->prev)
|
||||||
wwin->prev->next = wwin->next;
|
wwin->prev->next = wwin->next;
|
||||||
|
|
||||||
if (wwin->next)
|
if (wwin->next)
|
||||||
wwin->next->prev = wwin->prev;
|
wwin->next->prev = wwin->prev;
|
||||||
else {
|
else {
|
||||||
@@ -1716,9 +1664,8 @@ void wWindowFocus(WWindow *wwin, WWindow *owin)
|
|||||||
WWindow *oowner;
|
WWindow *oowner;
|
||||||
|
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
if (wPreferences.modelock) {
|
if (wPreferences.modelock)
|
||||||
XkbLockGroup(dpy, XkbUseCoreKbd, wwin->frame->languagemode);
|
XkbLockGroup(dpy, XkbUseCoreKbd, wwin->frame->languagemode);
|
||||||
}
|
|
||||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||||
|
|
||||||
wwin->flags.semi_focused = 0;
|
wwin->flags.semi_focused = 0;
|
||||||
@@ -1805,17 +1752,14 @@ void wWindowUpdateName(WWindow *wwin, char *newTitle)
|
|||||||
|
|
||||||
wwin->flags.wm_name_changed = 1;
|
wwin->flags.wm_name_changed = 1;
|
||||||
|
|
||||||
if (!newTitle) {
|
if (!newTitle)
|
||||||
/* the hint was removed */
|
title = DEF_WINDOW_TITLE; /* the hint was removed */
|
||||||
title = DEF_WINDOW_TITLE;
|
else
|
||||||
} else {
|
|
||||||
title = newTitle;
|
title = newTitle;
|
||||||
}
|
|
||||||
|
|
||||||
if (wFrameWindowChangeTitle(wwin->frame, title)) {
|
if (wFrameWindowChangeTitle(wwin->frame, title))
|
||||||
WMPostNotificationName(WMNChangedName, wwin, NULL);
|
WMPostNotificationName(WMNChangedName, wwin, NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
@@ -1963,9 +1907,9 @@ void wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
|||||||
&& !IS_OMNIPRESENT(wwin) && !wwin->flags.changing_workspace) {
|
&& !IS_OMNIPRESENT(wwin) && !wwin->flags.changing_workspace) {
|
||||||
|
|
||||||
wapp = wApplicationOf(wwin->main_window);
|
wapp = wApplicationOf(wwin->main_window);
|
||||||
if (wapp) {
|
if (wapp)
|
||||||
wapp->last_workspace = workspace;
|
wapp->last_workspace = workspace;
|
||||||
}
|
|
||||||
if (wwin->flags.miniaturized) {
|
if (wwin->flags.miniaturized) {
|
||||||
if (wwin->icon) {
|
if (wwin->icon) {
|
||||||
XUnmapWindow(dpy, wwin->icon->core->window);
|
XUnmapWindow(dpy, wwin->icon->core->window);
|
||||||
@@ -1989,9 +1933,7 @@ void wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
|||||||
}
|
}
|
||||||
if (!IS_OMNIPRESENT(wwin)) {
|
if (!IS_OMNIPRESENT(wwin)) {
|
||||||
int oldWorkspace = wwin->frame->workspace;
|
int oldWorkspace = wwin->frame->workspace;
|
||||||
|
|
||||||
wwin->frame->workspace = workspace;
|
wwin->frame->workspace = workspace;
|
||||||
|
|
||||||
WMPostNotificationName(WMNChangedWorkspace, wwin, (void *)(uintptr_t) oldWorkspace);
|
WMPostNotificationName(WMNChangedWorkspace, wwin, (void *)(uintptr_t) oldWorkspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2057,12 +1999,12 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||||||
* if the window is being moved but not resized then
|
* if the window is being moved but not resized then
|
||||||
* send a synthetic ConfigureNotify
|
* send a synthetic ConfigureNotify
|
||||||
*/
|
*/
|
||||||
if ((req_x != wwin->frame_x || req_y != wwin->frame_y) && !resize) {
|
if ((req_x != wwin->frame_x || req_y != wwin->frame_y) && !resize)
|
||||||
synth_notify = True;
|
synth_notify = True;
|
||||||
}
|
|
||||||
|
|
||||||
if (WFLAGP(wwin, dont_move_off))
|
if (WFLAGP(wwin, dont_move_off))
|
||||||
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y, req_width, req_height);
|
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y, req_width, req_height);
|
||||||
|
|
||||||
if (resize) {
|
if (resize) {
|
||||||
if (req_width < MIN_WINDOW_SIZE)
|
if (req_width < MIN_WINDOW_SIZE)
|
||||||
req_width = MIN_WINDOW_SIZE;
|
req_width = MIN_WINDOW_SIZE;
|
||||||
@@ -2107,9 +2049,8 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||||||
wwin->client.y += FRAME_BORDER_WIDTH;
|
wwin->client.y += FRAME_BORDER_WIDTH;
|
||||||
}
|
}
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (wShapeSupported && wwin->flags.shaped && resize) {
|
if (wShapeSupported && wwin->flags.shaped && resize)
|
||||||
wWindowSetShape(wwin);
|
wWindowSetShape(wwin);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (synth_notify)
|
if (synth_notify)
|
||||||
@@ -2124,9 +2065,8 @@ void wWindowMove(WWindow *wwin, int req_x, int req_y)
|
|||||||
int synth_notify = False;
|
int synth_notify = False;
|
||||||
|
|
||||||
/* Send a synthetic ConfigureNotify event for every window movement. */
|
/* Send a synthetic ConfigureNotify event for every window movement. */
|
||||||
if ((req_x != wwin->frame_x || req_y != wwin->frame_y)) {
|
if ((req_x != wwin->frame_x || req_y != wwin->frame_y))
|
||||||
synth_notify = True;
|
synth_notify = True;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
/* A single synthetic ConfigureNotify event is sent at the end of
|
/* A single synthetic ConfigureNotify event is sent at the end of
|
||||||
* a completed (opaque) movement in moveres.c */
|
* a completed (opaque) movement in moveres.c */
|
||||||
@@ -2168,11 +2108,10 @@ void wWindowUpdateButtonImages(WWindow *wwin)
|
|||||||
if (wwin->wm_gnustep_attr && wwin->wm_gnustep_attr->flags & GSMiniaturizePixmapAttr) {
|
if (wwin->wm_gnustep_attr && wwin->wm_gnustep_attr->flags & GSMiniaturizePixmapAttr) {
|
||||||
pixmap = wwin->wm_gnustep_attr->miniaturize_pixmap;
|
pixmap = wwin->wm_gnustep_attr->miniaturize_pixmap;
|
||||||
|
|
||||||
if (wwin->wm_gnustep_attr->flags & GSMiniaturizeMaskAttr) {
|
if (wwin->wm_gnustep_attr->flags & GSMiniaturizeMaskAttr)
|
||||||
mask = wwin->wm_gnustep_attr->miniaturize_mask;
|
mask = wwin->wm_gnustep_attr->miniaturize_mask;
|
||||||
} else {
|
else
|
||||||
mask = None;
|
mask = None;
|
||||||
}
|
|
||||||
|
|
||||||
if (fwin->lbutton_image
|
if (fwin->lbutton_image
|
||||||
&& (fwin->lbutton_image->image != pixmap || fwin->lbutton_image->mask != mask)) {
|
&& (fwin->lbutton_image->image != pixmap || fwin->lbutton_image->mask != mask)) {
|
||||||
@@ -2186,17 +2125,17 @@ void wWindowUpdateButtonImages(WWindow *wwin)
|
|||||||
fwin->lbutton_image->client_owned_mask = 1;
|
fwin->lbutton_image->client_owned_mask = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fwin->lbutton_image && !fwin->lbutton_image->shared) {
|
if (fwin->lbutton_image && !fwin->lbutton_image->shared)
|
||||||
wPixmapDestroy(fwin->lbutton_image);
|
wPixmapDestroy(fwin->lbutton_image);
|
||||||
}
|
|
||||||
fwin->lbutton_image = scr->b_pixmaps[WBUT_ICONIFY];
|
fwin->lbutton_image = scr->b_pixmaps[WBUT_ICONIFY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (!WFLAGP(wwin, no_language_button)) {
|
if (!WFLAGP(wwin, no_language_button)) {
|
||||||
if (fwin->languagebutton_image && !fwin->languagebutton_image->shared) {
|
if (fwin->languagebutton_image && !fwin->languagebutton_image->shared)
|
||||||
wPixmapDestroy(fwin->languagebutton_image);
|
wPixmapDestroy(fwin->languagebutton_image);
|
||||||
}
|
|
||||||
fwin->languagebutton_image = scr->b_pixmaps[WBUT_XKBGROUP1 + fwin->languagemode];
|
fwin->languagebutton_image = scr->b_pixmaps[WBUT_XKBGROUP1 + fwin->languagemode];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -2228,21 +2167,18 @@ void wWindowUpdateButtonImages(WWindow *wwin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (WFLAGP(wwin, kill_close)) {
|
} else if (WFLAGP(wwin, kill_close)) {
|
||||||
|
|
||||||
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
||||||
wPixmapDestroy(fwin->rbutton_image);
|
wPixmapDestroy(fwin->rbutton_image);
|
||||||
|
|
||||||
fwin->rbutton_image = scr->b_pixmaps[WBUT_KILL];
|
fwin->rbutton_image = scr->b_pixmaps[WBUT_KILL];
|
||||||
|
|
||||||
} else if (MGFLAGP(wwin, broken_close)) {
|
} else if (MGFLAGP(wwin, broken_close)) {
|
||||||
|
|
||||||
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
||||||
wPixmapDestroy(fwin->rbutton_image);
|
wPixmapDestroy(fwin->rbutton_image);
|
||||||
|
|
||||||
fwin->rbutton_image = scr->b_pixmaps[WBUT_BROKENCLOSE];
|
fwin->rbutton_image = scr->b_pixmaps[WBUT_BROKENCLOSE];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
if (fwin->rbutton_image && !fwin->rbutton_image->shared)
|
||||||
wPixmapDestroy(fwin->rbutton_image);
|
wPixmapDestroy(fwin->rbutton_image);
|
||||||
|
|
||||||
@@ -2300,9 +2236,8 @@ void wWindowConfigureBorders(WWindow *wwin)
|
|||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (!WFLAGP(wwin, no_language_button)
|
if (!WFLAGP(wwin, no_language_button)
|
||||||
&& wwin->frame->flags.hide_language_button) {
|
&& wwin->frame->flags.hide_language_button)
|
||||||
flags |= WFF_LANGUAGE_BUTTON;
|
flags |= WFF_LANGUAGE_BUTTON;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!WFLAGP(wwin, no_close_button)
|
if (!WFLAGP(wwin, no_close_button)
|
||||||
@@ -2333,9 +2268,8 @@ void wWindowConfigureBorders(WWindow *wwin)
|
|||||||
wFrameWindowHideButton(wwin->frame, flags);
|
wFrameWindowHideButton(wwin->frame, flags);
|
||||||
|
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (wShapeSupported && wwin->flags.shaped) {
|
if (wShapeSupported && wwin->flags.shaped)
|
||||||
wWindowSetShape(wwin);
|
wWindowSetShape(wwin);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2425,15 +2359,13 @@ void wWindowSetShape(WWindow * wwin)
|
|||||||
int ordering;
|
int ordering;
|
||||||
|
|
||||||
/* only shape is the client's */
|
/* only shape is the client's */
|
||||||
if (!HAS_TITLEBAR(wwin) && !HAS_RESIZEBAR(wwin)) {
|
if (!HAS_TITLEBAR(wwin) && !HAS_RESIZEBAR(wwin))
|
||||||
goto alt_code;
|
goto alt_code;
|
||||||
}
|
|
||||||
|
|
||||||
/* Get array of rectangles describing the shape mask */
|
/* Get array of rectangles describing the shape mask */
|
||||||
rects = XShapeGetRectangles(dpy, wwin->client_win, ShapeBounding, &count, &ordering);
|
rects = XShapeGetRectangles(dpy, wwin->client_win, ShapeBounding, &count, &ordering);
|
||||||
if (!rects) {
|
if (!rects)
|
||||||
goto alt_code;
|
goto alt_code;
|
||||||
}
|
|
||||||
|
|
||||||
urec = malloc(sizeof(XRectangle) * (count + 2));
|
urec = malloc(sizeof(XRectangle) * (count + 2));
|
||||||
if (!urec) {
|
if (!urec) {
|
||||||
@@ -2832,9 +2764,8 @@ static void titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event->xbutton.button == Button3) {
|
} else if (event->xbutton.button == Button3) {
|
||||||
if (event->xbutton.state & MOD_MASK) {
|
if (event->xbutton.state & MOD_MASK)
|
||||||
wHideOtherApplications(wwin);
|
wHideOtherApplications(wwin);
|
||||||
}
|
|
||||||
} else if (event->xbutton.button == Button2) {
|
} else if (event->xbutton.button == Button2) {
|
||||||
wSelectWindow(wwin, !wwin->flags.selected);
|
wSelectWindow(wwin, !wwin->flags.selected);
|
||||||
} else if (event->xbutton.button == WINGsConfiguration.mouseWheelUp) {
|
} else if (event->xbutton.button == WINGsConfiguration.mouseWheelUp) {
|
||||||
@@ -2915,30 +2846,26 @@ static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
WWindow *wwin = (WWindow *) data;
|
WWindow *wwin = (WWindow *) data;
|
||||||
|
|
||||||
#ifndef NUMLOCK_HACK
|
#ifndef NUMLOCK_HACK
|
||||||
if ((event->xbutton.state & ValidModMask)
|
if ((event->xbutton.state & ValidModMask) != (event->xbutton.state & ~LockMask))
|
||||||
!= (event->xbutton.state & ~LockMask)) {
|
|
||||||
wwarning(_("The NumLock, ScrollLock or similar key seems to be turned on. "
|
wwarning(_("The NumLock, ScrollLock or similar key seems to be turned on. "
|
||||||
"Turn it off or some mouse actions and keyboard shortcuts will not work."));
|
"Turn it off or some mouse actions and keyboard shortcuts will not work."));
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
event->xbutton.state &= ValidModMask;
|
event->xbutton.state &= ValidModMask;
|
||||||
|
|
||||||
CloseWindowMenu(wwin->screen_ptr);
|
CloseWindowMenu(wwin->screen_ptr);
|
||||||
|
|
||||||
if (wPreferences.focus_mode == WKF_CLICK && !(event->xbutton.state & ControlMask)
|
if (wPreferences.focus_mode == WKF_CLICK && !(event->xbutton.state & ControlMask)
|
||||||
&& !WFLAGP(wwin, no_focusable)) {
|
&& !WFLAGP(wwin, no_focusable))
|
||||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||||
}
|
|
||||||
|
|
||||||
if (event->xbutton.button == Button1 || event->xbutton.button == Button2) {
|
if (event->xbutton.button == Button1 || event->xbutton.button == Button2) {
|
||||||
|
|
||||||
if (event->xbutton.button == Button1) {
|
if (event->xbutton.button == Button1) {
|
||||||
if (event->xbutton.state & MOD_MASK) {
|
if (event->xbutton.state & MOD_MASK)
|
||||||
wLowerFrame(wwin->frame->core);
|
wLowerFrame(wwin->frame->core);
|
||||||
} else {
|
else
|
||||||
wRaiseFrame(wwin->frame->core);
|
wRaiseFrame(wwin->frame->core);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ((event->xbutton.state & ShiftMask)
|
if ((event->xbutton.state & ShiftMask)
|
||||||
&& !(event->xbutton.state & ControlMask)) {
|
&& !(event->xbutton.state & ControlMask)) {
|
||||||
wSelectWindow(wwin, !wwin->flags.selected);
|
wSelectWindow(wwin, !wwin->flags.selected);
|
||||||
@@ -3009,12 +2936,11 @@ static void windowCloseDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* send delete message */
|
/* send delete message */
|
||||||
if (wwin->protocols.DELETE_WINDOW) {
|
if (wwin->protocols.DELETE_WINDOW)
|
||||||
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);
|
wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp);
|
||||||
} else {
|
else
|
||||||
wClientKill(wwin);
|
wClientKill(wwin);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
static void windowLanguageClick(WCoreWindow *sender, void *data, XEvent *event)
|
static void windowLanguageClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||||
|
|||||||
Reference in New Issue
Block a user