mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
added None option to MoveDisplay and ResizeDisplay
fixed window instance enumeration bug
This commit is contained in:
@@ -151,7 +151,7 @@ typedef enum {
|
|||||||
#define WDIS_CENTER 1 /* center of screen */
|
#define WDIS_CENTER 1 /* center of screen */
|
||||||
#define WDIS_TOPLEFT 2 /* top left corner of screen */
|
#define WDIS_TOPLEFT 2 /* top left corner of screen */
|
||||||
#define WDIS_FRAME_CENTER 3 /* center of the frame */
|
#define WDIS_FRAME_CENTER 3 /* center of the frame */
|
||||||
|
#define WDIS_NONE 4
|
||||||
|
|
||||||
/* keyboard input focus mode */
|
/* keyboard input focus mode */
|
||||||
#define WKF_CLICK 0
|
#define WKF_CLICK 0
|
||||||
|
|||||||
@@ -433,6 +433,40 @@ wApplicationCreate(WScreen *scr, Window main_window)
|
|||||||
extractClientIcon(wapp->app_icon);
|
extractClientIcon(wapp->app_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* set the application instance index */
|
||||||
|
{
|
||||||
|
WApplication *list = scr->wapp_list;
|
||||||
|
int index = 0;
|
||||||
|
WWindow *wwin = wapp->main_window_desc;
|
||||||
|
/*
|
||||||
|
if (!WFLAGP(wwin, collapse_appicons))
|
||||||
|
return 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* look for a free index # */
|
||||||
|
while (list) {
|
||||||
|
if (strcmp(wwin->wm_instance,
|
||||||
|
list->main_window_desc->wm_instance) == 0
|
||||||
|
&&
|
||||||
|
strcmp(wwin->wm_class,
|
||||||
|
list->main_window_desc->wm_class) == 0) {
|
||||||
|
|
||||||
|
if (list->index == index) {
|
||||||
|
index++;
|
||||||
|
|
||||||
|
/* restart list traversal */
|
||||||
|
list = scr->wapp_list;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
wapp->index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wSoundPlay(WSOUND_APPSTART);
|
wSoundPlay(WSOUND_APPSTART);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -551,30 +585,6 @@ wApplicationSetCollapse(WApplication *app, Bool flag)
|
|||||||
int
|
int
|
||||||
wApplicationIndexOfGroup(WApplication *app)
|
wApplicationIndexOfGroup(WApplication *app)
|
||||||
{
|
{
|
||||||
WApplication *list = app->main_window_desc->screen_ptr->wapp_list;
|
return app->index;
|
||||||
int index = 0;
|
|
||||||
WWindow *wwin = app->main_window_desc;
|
|
||||||
/*
|
|
||||||
if (!WFLAGP(wwin, collapse_appicons))
|
|
||||||
return 0;
|
|
||||||
*/
|
|
||||||
|
|
||||||
while (list) {
|
|
||||||
if (app == list)
|
|
||||||
return index;
|
|
||||||
|
|
||||||
if (strcmp(wwin->wm_instance,
|
|
||||||
list->main_window_desc->wm_instance) == 0
|
|
||||||
&&
|
|
||||||
strcmp(wwin->wm_class,
|
|
||||||
list->main_window_desc->wm_class) == 0)
|
|
||||||
index++;
|
|
||||||
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
puts("OH SHIT!?!?!? HOW THE FUCK DID WE GET HERE!?!?!?!?!");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ typedef struct WApplication {
|
|||||||
|
|
||||||
struct WAppIcon *app_icon;
|
struct WAppIcon *app_icon;
|
||||||
|
|
||||||
|
int index;
|
||||||
|
|
||||||
int refcount;
|
int refcount;
|
||||||
|
|
||||||
struct WWindow *last_focused; /* focused window before hide */
|
struct WWindow *last_focused; /* focused window before hide */
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ static WOptionEnumeration sePlacements[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static WOptionEnumeration seGeomDisplays[] = {
|
static WOptionEnumeration seGeomDisplays[] = {
|
||||||
|
{"None", WDIS_NONE, 0},
|
||||||
{"Center", WDIS_CENTER, 0},
|
{"Center", WDIS_CENTER, 0},
|
||||||
{"Corner", WDIS_TOPLEFT, 0},
|
{"Corner", WDIS_TOPLEFT, 0},
|
||||||
{"Floating", WDIS_FRAME_CENTER, 0},
|
{"Floating", WDIS_FRAME_CENTER, 0},
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ keyPressHandler(XEvent *event, void *data)
|
|||||||
int didx;
|
int didx;
|
||||||
int item;
|
int item;
|
||||||
WMList *list = NULL;
|
WMList *list = NULL;
|
||||||
|
|
||||||
if (event->type == KeyRelease)
|
if (event->type == KeyRelease)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1229,16 +1229,16 @@ wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title)
|
|||||||
|
|
||||||
if (fwin->title)
|
if (fwin->title)
|
||||||
wfree(fwin->title);
|
wfree(fwin->title);
|
||||||
|
|
||||||
fwin->title = wstrdup(new_title);
|
fwin->title = wstrdup(new_title);
|
||||||
|
|
||||||
if (fwin->titlebar) {
|
if (fwin->titlebar) {
|
||||||
XClearWindow(dpy, fwin->titlebar->window);
|
XClearWindow(dpy, fwin->titlebar->window);
|
||||||
|
|
||||||
wFrameWindowPaint(fwin);
|
wFrameWindowPaint(fwin);
|
||||||
}
|
}
|
||||||
checkTitleSize(fwin);
|
checkTitleSize(fwin);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
/* How many different types of geometry/position
|
/* How many different types of geometry/position
|
||||||
display thingies are there? */
|
display thingies are there? */
|
||||||
#define NUM_DISPLAYS 4
|
#define NUM_DISPLAYS 5
|
||||||
|
|
||||||
#define LEFT 1
|
#define LEFT 1
|
||||||
#define RIGHT 2
|
#define RIGHT 2
|
||||||
@@ -167,7 +167,8 @@ cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
|||||||
wPreferences.move_display++;
|
wPreferences.move_display++;
|
||||||
wPreferences.move_display %= NUM_DISPLAYS;
|
wPreferences.move_display %= NUM_DISPLAYS;
|
||||||
|
|
||||||
if (wPreferences.move_display == WDIS_NEW) {
|
if (wPreferences.move_display == WDIS_NEW
|
||||||
|
|| wPreferences.move_display == WDIS_NONE) {
|
||||||
WMUnmapWidget(scr->gview);
|
WMUnmapWidget(scr->gview);
|
||||||
} else {
|
} else {
|
||||||
if (wPreferences.move_display == WDIS_CENTER) {
|
if (wPreferences.move_display == WDIS_CENTER) {
|
||||||
@@ -188,7 +189,8 @@ mapPositionDisplay(WWindow *wwin, int x, int y, int w, int h)
|
|||||||
{
|
{
|
||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
|
|
||||||
if (wPreferences.move_display == WDIS_NEW) {
|
if (wPreferences.move_display == WDIS_NEW
|
||||||
|
|| wPreferences.move_display == WDIS_NONE) {
|
||||||
return;
|
return;
|
||||||
} else if (wPreferences.move_display == WDIS_CENTER) {
|
} else if (wPreferences.move_display == WDIS_CENTER) {
|
||||||
moveGeometryDisplayCentered(scr, scr->scr_width / 2,
|
moveGeometryDisplayCentered(scr, scr->scr_width / 2,
|
||||||
@@ -350,7 +352,8 @@ cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
|
|||||||
wPreferences.size_display++;
|
wPreferences.size_display++;
|
||||||
wPreferences.size_display %= NUM_DISPLAYS;
|
wPreferences.size_display %= NUM_DISPLAYS;
|
||||||
|
|
||||||
if (wPreferences.size_display == WDIS_NEW) {
|
if (wPreferences.size_display == WDIS_NEW
|
||||||
|
|| wPreferences.size_display == WDIS_NONE) {
|
||||||
WMUnmapWidget(scr->gview);
|
WMUnmapWidget(scr->gview);
|
||||||
} else {
|
} else {
|
||||||
if (wPreferences.size_display == WDIS_CENTER) {
|
if (wPreferences.size_display == WDIS_CENTER) {
|
||||||
@@ -372,7 +375,8 @@ mapGeometryDisplay(WWindow *wwin, int x, int y, int w, int h)
|
|||||||
{
|
{
|
||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
|
|
||||||
if (wPreferences.size_display == WDIS_NEW)
|
if (wPreferences.size_display == WDIS_NEW
|
||||||
|
|| wPreferences.size_display == WDIS_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (wPreferences.size_display == WDIS_CENTER) {
|
if (wPreferences.size_display == WDIS_CENTER) {
|
||||||
|
|||||||
Reference in New Issue
Block a user