[scratch] Remove scratch client support.

This can be done in Lua now.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-20 19:47:29 +02:00
parent fe3c152f2b
commit dc431ec430
5 changed files with 21 additions and 29 deletions

View File

@ -125,9 +125,6 @@ client_isvisible_anyscreen(client_t *c)
if(!c) if(!c)
return false; return false;
if(globalconf.scratch.client == c)
return globalconf.scratch.isvisible;
for(screen = 0; screen < globalconf.screens_info->nscreen; screen++) for(screen = 0; screen < globalconf.screens_info->nscreen; screen++)
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
if(tag->selected && is_client_tagged(c, tag)) if(tag->selected && is_client_tagged(c, tag))
@ -150,9 +147,6 @@ client_isvisible(client_t *c, int screen)
if(!c || c->screen != screen) if(!c || c->screen != screen)
return false; return false;
if(globalconf.scratch.client == c)
return globalconf.scratch.isvisible;
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
if(tag->selected && is_client_tagged(c, tag)) if(tag->selected && is_client_tagged(c, tag))
return true; return true;
@ -676,8 +670,6 @@ client_unmanage(client_t *c)
/* remove client everywhere */ /* remove client everywhere */
client_list_detach(&globalconf.clients, c); client_list_detach(&globalconf.clients, c);
focus_delete_client(c); focus_delete_client(c);
if(globalconf.scratch.client == c)
globalconf.scratch.client = NULL;
for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next) for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next)
untag_client(c, tag); untag_client(c, tag);

View File

@ -74,9 +74,7 @@ focus_get_latest_client_for_tags(tag_t **t, int nindex)
int i = 0; int i = 0;
for(node = globalconf.focus; node; node = node->next) for(node = globalconf.focus; node; node = node->next)
if(node->client && ((!node->client->skip if(node->client && !node->client->skip)
&& node->client != globalconf.scratch.client)
|| globalconf.scratch.isvisible))
for(tags = t; *tags; tags++) for(tags = t; *tags; tags++)
if(is_client_tagged(node->client, *tags)) if(is_client_tagged(node->client, *tags))
{ {

View File

@ -33,7 +33,7 @@
#include "common/xscreen.h" #include "common/xscreen.h"
#include "common/refcount.h" #include "common/refcount.h"
/** stacking layout */ /** Stacking layout layers */
typedef enum typedef enum
{ {
LAYER_DESKTOP, LAYER_DESKTOP,
@ -48,16 +48,24 @@ typedef enum
enum enum
{ CurNormal, CurResize, CurMove, CurLast }; { CurNormal, CurResize, CurMove, CurLast };
/** Titlebar template structure */
typedef struct typedef struct
{ {
/** Ref count */ /** Ref count */
int refcount; int refcount;
/** Position */
position_t position; position_t position;
/** Alignment on window */
alignment_t align; alignment_t align;
/** Width and height */
int width, height; int width, height;
/** Various text used for rendering */
char *text_normal, *text_focus, *text_urgent; char *text_normal, *text_focus, *text_urgent;
} titlebar_t; } titlebar_t;
/** Delete a titlebar structure.
* \param t The titlebar to destroy.
*/
static inline void static inline void
titlebar_delete(titlebar_t **t) titlebar_delete(titlebar_t **t)
{ {
@ -151,6 +159,9 @@ struct widget_node_t
widget_node_t *prev, *next; widget_node_t *prev, *next;
}; };
/** Delete a widget structure.
* \param widget The widget to destroy.
*/
static inline void static inline void
widget_delete(widget_t **widget) widget_delete(widget_t **widget)
{ {
@ -162,6 +173,9 @@ widget_delete(widget_t **widget)
DO_RCNT(widget_t, widget, widget_delete) DO_RCNT(widget_t, widget, widget_delete)
/** Delete a widget node structure.
* \param node The node to destroy.
*/
static inline void static inline void
widget_node_delete(widget_node_t **node) widget_node_delete(widget_node_t **node)
{ {
@ -259,6 +273,7 @@ struct client_t
typedef struct client_node_t client_node_t; typedef struct client_node_t client_node_t;
struct client_node_t struct client_node_t
{ {
/** The client */
client_t *client; client_t *client;
/** Next and previous client_nodes */ /** Next and previous client_nodes */
client_node_t *prev, *next; client_node_t *prev, *next;
@ -288,7 +303,7 @@ struct _tag_t
tag_t *prev, *next; tag_t *prev, *next;
}; };
/** tag_client_node type */ /** Tag client link type */
typedef struct tag_client_node_t tag_client_node_t; typedef struct tag_client_node_t tag_client_node_t;
struct tag_client_node_t struct tag_client_node_t
{ {
@ -312,6 +327,7 @@ typedef struct
} Padding; } Padding;
typedef area_t (FloatingPlacement)(client_t *); typedef area_t (FloatingPlacement)(client_t *);
typedef struct typedef struct
{ {
/** true if we need to arrange() */ /** true if we need to arrange() */
@ -363,12 +379,6 @@ struct AwesomeConf
xcb_cursor_t cursor[CurLast]; xcb_cursor_t cursor[CurLast];
/** client_ts list */ /** client_ts list */
client_t *clients; client_t *clients;
/** Scratch client */
struct
{
client_t *client;
bool isvisible;
} scratch;
/** Path to config file */ /** Path to config file */
char *configpath; char *configpath;
/** Floating window placement algo */ /** Floating window placement algo */

View File

@ -83,7 +83,7 @@ tag_isoccupied(tag_t *t)
client_t *c; client_t *c;
for(c = globalconf.clients; c; c = c->next) for(c = globalconf.clients; c; c = c->next)
if(is_client_tagged(c, t) && !c->skip && c != globalconf.scratch.client) if(is_client_tagged(c, t) && !c->skip)
return true; return true;
return false; return false;

View File

@ -160,15 +160,7 @@ tasklist_draw(widget_node_t *w, statusbar_t *statusbar, int offset, int used)
p_delete(&text); p_delete(&text);
if(c == globalconf.scratch.client) if(c->isfloating || c->ismax)
{
area.x = w->area.x + icon_width + box_width * i;
area.y = w->area.y;
area.width = (globalconf.font->height + 2) / 3;
area.height = (globalconf.font->height + 2) / 3;
draw_rectangle(statusbar->ctx, area, 1.0, c->isfloating, statusbar->colors.fg);
}
else if(c->isfloating || c->ismax)
draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i, draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i,
w->area.y, w->area.y,
(globalconf.font->height + 2) / 4, (globalconf.font->height + 2) / 4,