1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

Window comments cleanup

This patch only add some tabs the window.h (only window struct area).

The main change is that moves this block to switchpanel.c, because
is only used there:

       ((w)->wm_gnustep_attr->flags & GSWindowLevelAttr) && \
       ((w)->wm_gnustep_attr->window_level == WMMainMenuWindowLevel || \
        (w)->wm_gnustep_attr->window_level == WMSubmenuWindowLevel))

The patch also include two comments in the window's image:

- WIcon icon is only used when the window is minimized, else is NULL
- RImage has the window image, used in switchpanel,...
This commit is contained in:
Rodolfo García Peñas (kix)
2012-11-10 20:54:43 +01:00
committed by Carlos R. Mafra
parent cc1503a2f0
commit f846b7cdd3
2 changed files with 103 additions and 110 deletions

View File

@@ -38,6 +38,11 @@
#include "workspace.h" #include "workspace.h"
#include "framewin.h" #include "framewin.h"
#define IS_GNUSTEP_MENU(w) ((w)->wm_gnustep_attr && \
((w)->wm_gnustep_attr->flags & GSWindowLevelAttr) && \
((w)->wm_gnustep_attr->window_level == WMMainMenuWindowLevel || \
(w)->wm_gnustep_attr->window_level == WMSubmenuWindowLevel))
/********* Global Variables *******/ /********* Global Variables *******/
extern WPreferences wPreferences; extern WPreferences wPreferences;

View File

@@ -175,146 +175,134 @@ typedef struct WFakeGroupLeader {
* structure created when it's being first mapped. * structure created when it's being first mapped.
*/ */
typedef struct WWindow { typedef struct WWindow {
struct WWindow *prev; /* window focus list */ struct WWindow *prev; /* window focus list */
struct WWindow *next; struct WWindow *next;
WScreen *screen_ptr; /* pointer to the screen structure */ WScreen *screen_ptr; /* pointer to the screen structure */
WWindowAttributes user_flags; /* window attribute flags set by user */ WWindowAttributes user_flags; /* window attribute flags set by user */
WWindowAttributes defined_user_flags;/* mask for user_flags */ WWindowAttributes defined_user_flags; /* mask for user_flags */
WWindowAttributes client_flags; /* window attribute flags set by app WWindowAttributes client_flags; /* window attribute flags set by app
* initialized with global defaults */ * initialized with global defaults */
struct InspectorPanel *inspector; /* pointer to attribute editor panel */ struct InspectorPanel *inspector; /* pointer to attribute editor panel */
struct WFrameWindow *frame; /* the frame window */ struct WFrameWindow *frame; /* the frame window */
int frame_x, frame_y; /* position of the frame in root*/ int frame_x, frame_y; /* position of the frame in root*/
struct { struct {
int x, y; int x, y;
unsigned int width, height; /* original geometry of the window */ unsigned int width, height; /* original geometry of the window */
} old_geometry; /* (before things like maximize) */ } old_geometry; /* (before things like maximize) */
struct { struct {
int x, y; int x, y;
unsigned int width, height; /* original geometry of the window */ unsigned int width, height; /* original geometry of the window */
} bfs_geometry; /* (before fullscreen) */ } bfs_geometry; /* (before fullscreen) */
int maximus_x; /* size after Maximusizing */ int maximus_x; /* size after Maximusizing */
int maximus_y; int maximus_y;
/* client window info */ /* client window info */
short old_border_width; /* original border width of client_win*/ short old_border_width; /* original border width of client_win*/
Window client_win; /* the window we're managing */ Window client_win; /* the window we're managing */
WObjDescriptor client_descriptor; /* dummy descriptor for client */ WObjDescriptor client_descriptor; /* dummy descriptor for client */
struct { struct {
int x, y; /* position of *client* relative int x, y; /* position of *client* relative
* to root */ * to root */
unsigned int width, height; /* size of the client window */ unsigned int width, height; /* size of the client window */
} client; } client;
XSizeHints *normal_hints; /* WM_NORMAL_HINTS */ XSizeHints *normal_hints; /* WM_NORMAL_HINTS */
XWMHints *wm_hints; /* WM_HINTS (optional) */ XWMHints *wm_hints; /* WM_HINTS (optional) */
char *wm_instance; /* instance of WM_CLASS */ char *wm_instance; /* instance of WM_CLASS */
char *wm_class; /* class of WM_CLASS */ char *wm_class; /* class of WM_CLASS */
GNUstepWMAttributes *wm_gnustep_attr;/* GNUstep window attributes */ GNUstepWMAttributes *wm_gnustep_attr; /* GNUstep window attributes */
int state; /* state as in ICCCM */ int state; /* state as in ICCCM */
Window transient_for; /* WM_TRANSIENT_FOR */ Window transient_for; /* WM_TRANSIENT_FOR */
WFakeGroupLeader *fake_group; /* Fake group leader for grouping into WFakeGroupLeader *fake_group; /* Fake group leader for grouping into
a single appicon */ * a single appicon */
Window group_id; /* the leader window of the group */ Window group_id; /* the leader window of the group */
Window client_leader; /* WM_CLIENT_LEADER if not Window client_leader; /* WM_CLIENT_LEADER if not
internal_window */ * internal_window */
Window main_window; /* main window for the application */ Window main_window; /* main window for the application */
Window orig_main_window; /* original main window of application.
* used for the shared appicon thing */
Window orig_main_window; /* original main window of application. int cmap_window_no;
used for the shared appicon thing */ Window *cmap_windows;
int cmap_window_no; /* protocols */
Window *cmap_windows; WProtocols protocols; /* accepted WM_PROTOCOLS */
/* protocols */ FocusMode focus_mode; /* type of keyboard input focus */
WProtocols protocols; /* accepted WM_PROTOCOLS */
FocusMode focus_mode; /* type of keyboard input focus */ long event_mask; /* the event mask thats selected */
long event_mask; /* the event mask thats selected */ /* state flags */
struct {
struct { unsigned int mapped:1;
/* state flags */ unsigned int focused:1;
unsigned int mapped:1; unsigned int miniaturized:1;
unsigned int focused:1; unsigned int hidden:1;
unsigned int miniaturized:1; unsigned int shaded:1;
unsigned int hidden:1; unsigned int maximized:5;
unsigned int shaded:1; unsigned int old_maximized:5;
unsigned int maximized:5; unsigned int fullscreen:1;
unsigned int old_maximized:5; unsigned int omnipresent:1;
unsigned int fullscreen:1; unsigned int semi_focused:1;
unsigned int omnipresent:1; /* window type flags */
unsigned int urgent:1; /* if wm_hints says this is urgent */
unsigned int semi_focused:1;
/* window type flags */
unsigned int urgent:1; /* if wm_hints says this is urgent */
#ifdef SHAPE #ifdef SHAPE
unsigned int shaped:1; unsigned int shaped:1;
#endif #endif
/* info flags */ /* info flags */
unsigned int is_gnustep:1; /* 1 if the window belongs to a GNUstep unsigned int is_gnustep:1; /* 1 if the window belongs to a GNUstep
app */ * app */
unsigned int is_dockapp:1; /* 1 if the window belongs to a DockApp */ unsigned int is_dockapp:1; /* 1 if the window belongs to a DockApp */
unsigned int icon_moved:1; /* icon for this window was moved unsigned int icon_moved:1; /* icon for this window was moved
* by the user */ * by the user */
unsigned int selected:1; /* multiple window selection */ unsigned int selected:1; /* multiple window selection */
unsigned int skip_next_animation:1; unsigned int skip_next_animation:1;
unsigned int internal_window:1; unsigned int internal_window:1;
unsigned int changing_workspace:1; unsigned int changing_workspace:1;
unsigned int inspector_open:1; /* attrib inspector is already open */ unsigned int inspector_open:1; /* attrib inspector is already open */
unsigned int destroyed:1; /* window was already destroyed */ unsigned int destroyed:1; /* window was already destroyed */
unsigned int menu_open_for_me:1; /* window commands menu */ unsigned int menu_open_for_me:1;/* window commands menu */
unsigned int obscured:1; /* window is obscured */ unsigned int obscured:1; /* window is obscured */
unsigned int net_skip_pager:1; unsigned int net_skip_pager:1;
unsigned int net_handle_icon:1; unsigned int net_handle_icon:1;
unsigned int net_show_desktop:1; unsigned int net_show_desktop:1;
unsigned int net_has_title:1; /* use netwm version of WM_NAME */ unsigned int net_has_title:1; /* use netwm version of WM_NAME */
unsigned int net_has_icon_title:1; unsigned int net_has_icon_title:1;
} flags; /* state of the window */ } flags; /* state of the window */
struct WIcon *icon; /* icon info for the window */ struct WIcon *icon; /* Window icon when miminized
int icon_x, icon_y; /* position of the icon */ * else is NULL! */
int icon_w, icon_h; int icon_x, icon_y; /* position of the icon */
RImage *net_icon_image; int icon_w, icon_h;
Atom type; RImage *net_icon_image; /* Window Image */
Atom type;
} WWindow; } WWindow;
#define HAS_TITLEBAR(w) (!(WFLAGP((w), no_titlebar) || (w)->flags.fullscreen))
#define HAS_TITLEBAR(w) (!(WFLAGP((w), no_titlebar) || (w)->flags.fullscreen)) #define HAS_RESIZEBAR(w) (!(WFLAGP((w), no_resizebar) || (w)->flags.fullscreen))
#define HAS_RESIZEBAR(w) (!(WFLAGP((w), no_resizebar) || (w)->flags.fullscreen)) #define HAS_BORDER(w) (!(WFLAGP((w), no_border) || (w)->flags.fullscreen))
#define HAS_BORDER(w) (!(WFLAGP((w), no_border) || (w)->flags.fullscreen)) #define IS_MOVABLE(w) (!(WFLAGP((w), no_movable) || (w)->flags.fullscreen))
#define IS_MOVABLE(w) (!(WFLAGP((w), no_movable) || (w)->flags.fullscreen)) #define IS_RESIZABLE(w) (!(WFLAGP((w), no_resizable) || (w)->flags.fullscreen))
#define IS_RESIZABLE(w) (!(WFLAGP((w), no_resizable) || (w)->flags.fullscreen)) #define IS_OMNIPRESENT(w) ((w)->flags.omnipresent | WFLAGP(w, omnipresent))
#define WINDOW_LEVEL(w) ((w)->frame->core->stacking->window_level)
/* XXX: CHECK THIS,.. IT SEEMED WEIRD TO ME!!! */
#define IS_OMNIPRESENT(w) ((w)->flags.omnipresent | WFLAGP(w, omnipresent))
#define WINDOW_LEVEL(w) ((w)->frame->core->stacking->window_level)
#define IS_GNUSTEP_MENU(w) ((w)->wm_gnustep_attr && \
((w)->wm_gnustep_attr->flags & GSWindowLevelAttr) && \
((w)->wm_gnustep_attr->window_level==WMMainMenuWindowLevel || \
(w)->wm_gnustep_attr->window_level==WMSubmenuWindowLevel))
/* /*
* Changes to this must update wWindowSaveState/getSavedState * Changes to this must update wWindowSaveState/getSavedState
*
*/ */
typedef struct WSavedState { typedef struct WSavedState {
int workspace; int workspace;