Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windowtypes + bar handling #22

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


#include "bar.h"
#include "util.h"

void
writebar(char *fmt, ...)
Expand All @@ -34,3 +35,9 @@ writebar(char *fmt, ...)
fflush(bar);
va_end(args);
}

void
setshowbar(Bar *bar, uint8_t state)
{
SETFLAG(bar->flags, _SHOW_BAR, !!state);
}
46 changes: 15 additions & 31 deletions bar.h
Original file line number Diff line number Diff line change
@@ -1,48 +1,32 @@
#ifndef BAR_H_
#define BAR_H_

#include "xcb_trl.h"


void writebar(char *fmt, ...);








/* Stuff we need
* _NET_WM_WINDOW_TYPE:
* _NET_WM_WINDOW_TYPE_DOCK
* _NET_WM_WINDOW_TYPE_UTILITY
* // probably not
* _NET_WM_WINDOW_TYPE_TOOLBAR
* _NET_WM_WINDOW_TYPE_MENU
*
* Maybe use the 0xFFFFFFFF suggestion? in _NET_WM_DESKTOP
*
* Prob could also compare XCB_ATOM_WM_NAME in the get property section?
*
*
* needs to be set -> _NET_WM_STICKY
*
*/



#include <stdint.h>

#include "xcb_trl.h"



#define _SHOW_BAR ((1 << 1))

#define SHOWBAR(B) (((B)->flags & _SHOW_BAR))


typedef struct Bar Bar;

struct Bar
{
int16_t x;
int16_t y;
uint16_t w;
uint16_t h;

uint8_t flags;

XCBWindow win;
};


void setshowbar(Bar *bar, uint8_t state);

#endif
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L ${XINERAMAF
CCFLAGS = ${CCVERSION} ${WARNINGFLAGS} ${INCS} ${CPPFLAGS} ${BINARY} ${PRELINKERFLAGS}
RELEASEFLAGS = ${CCFLAGS}

DEBUG = ${DEBUGFLAGS} -O
DEBUG = ${DEBUGFLAGS} -Og

SIZE = ${RELEASEFLAGS} -Os
# This sacrifies some speed for a 10-20% decrease in size
Expand Down
Loading