1
0
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:
kojima
2001-06-06 19:48:31 +00:00
parent eb0e33e0f5
commit d6feaa1c75
7 changed files with 52 additions and 35 deletions

View File

@@ -151,7 +151,7 @@ typedef enum {
#define WDIS_CENTER 1 /* center of screen */
#define WDIS_TOPLEFT 2 /* top left corner of screen */
#define WDIS_FRAME_CENTER 3 /* center of the frame */
#define WDIS_NONE 4
/* keyboard input focus mode */
#define WKF_CLICK 0

View File

@@ -433,6 +433,40 @@ wApplicationCreate(WScreen *scr, Window main_window)
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);
#ifdef DEBUG
@@ -551,30 +585,6 @@ wApplicationSetCollapse(WApplication *app, Bool flag)
int
wApplicationIndexOfGroup(WApplication *app)
{
WApplication *list = app->main_window_desc->screen_ptr->wapp_list;
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;
return app->index;
}

View File

@@ -36,6 +36,8 @@ typedef struct WApplication {
struct WAppIcon *app_icon;
int index;
int refcount;
struct WWindow *last_focused; /* focused window before hide */

View File

@@ -245,6 +245,7 @@ static WOptionEnumeration sePlacements[] = {
};
static WOptionEnumeration seGeomDisplays[] = {
{"None", WDIS_NONE, 0},
{"Center", WDIS_CENTER, 0},
{"Corner", WDIS_TOPLEFT, 0},
{"Floating", WDIS_FRAME_CENTER, 0},

View File

@@ -49,7 +49,7 @@
/* How many different types of geometry/position
display thingies are there? */
#define NUM_DISPLAYS 4
#define NUM_DISPLAYS 5
#define LEFT 1
#define RIGHT 2
@@ -167,7 +167,8 @@ cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
wPreferences.move_display++;
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);
} else {
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;
if (wPreferences.move_display == WDIS_NEW) {
if (wPreferences.move_display == WDIS_NEW
|| wPreferences.move_display == WDIS_NONE) {
return;
} else if (wPreferences.move_display == WDIS_CENTER) {
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 %= NUM_DISPLAYS;
if (wPreferences.size_display == WDIS_NEW) {
if (wPreferences.size_display == WDIS_NEW
|| wPreferences.size_display == WDIS_NONE) {
WMUnmapWidget(scr->gview);
} else {
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;
if (wPreferences.size_display == WDIS_NEW)
if (wPreferences.size_display == WDIS_NEW
|| wPreferences.size_display == WDIS_NONE)
return;
if (wPreferences.size_display == WDIS_CENTER) {