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

View File

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

View File

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

View File

@ -83,7 +83,7 @@ tag_isoccupied(tag_t *t)
client_t *c;
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 false;

View File

@ -160,15 +160,7 @@ tasklist_draw(widget_node_t *w, statusbar_t *statusbar, int offset, int used)
p_delete(&text);
if(c == globalconf.scratch.client)
{
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)
if(c->isfloating || c->ismax)
draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i,
w->area.y,
(globalconf.font->height + 2) / 4,