Skip to content

Commit

Permalink
Implemented 'async' client managing (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerjenigeUberMensch authored Aug 2, 2024
1 parent 1229e54 commit cd3b4ff
Show file tree
Hide file tree
Showing 6 changed files with 299 additions and 190 deletions.
45 changes: 23 additions & 22 deletions include/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,28 @@ enum KillType
};

/* Manage cookies */
enum ManageCookies
/* Manage cookies */
enum ManageClientProperties
{
ManageCookieAttributes,
ManageCookieGeometry,
ManageCookieTransient,
ManageCookieWType,
ManageCookieWState,
ManageCookieSizeHint,
ManageCookieWMHints,
ManageCookieClass,
ManageCookieWMProtocol,
ManageCookieStrutP,
ManageCookieStrut,
ManageCookieNetWMName,
ManageCookieWMName,
ManageCookiePid,
ManageCookieIcon,
ManageCookieMotif,
ManageClientAttributes,
ManageClientGeometry,
ManageClientTransient,
ManageClientWType,
ManageClientWState,
ManageClientSizeHint,
ManageClientWMHints,
ManageClientClass,
ManageClientWMProtocol,
ManageClientStrutP,
ManageClientStrut,
ManageClientNetWMName,
ManageClientWMName,
ManageClientPid,
ManageClientIcon,
ManageClientMotif,


ManageCookieLAST
ManageClientLAST
};

enum BarSides
Expand All @@ -100,7 +101,6 @@ enum BarSides


typedef struct Client Client;

/* extern structs */
struct Desktop;
struct Monitor;
Expand Down Expand Up @@ -174,7 +174,6 @@ struct Client
XCBColormap colormap; /* Clients colormap */
};


/* Applies the gravity shifts specified by the gravity onto the x and y coordinates.
*/
void applygravity(const enum XCBBitGravity gravity, int32_t *x, int32_t *y, const uint32_t width, const uint32_t height, const uint32_t border_width);
Expand Down Expand Up @@ -252,14 +251,16 @@ Client *laststack(struct Desktop *desk);
*/
Client *lastrstack(struct Desktop *desk);
/* requests for clients cookies. */
void managerequest(XCBWindow win, XCBCookie requests[ManageCookieLAST]);
void managecleanup(void *replies[ManageClientLAST]);
void managerequest(XCBWindow win, XCBCookie requests[ManageClientLAST]);
void managereplies(XCBCookie requests[ManageClientLAST], void *replies[ManageClientLAST]);
/* Part of main event loop "run()"
* Manages AKA adds the window to our current or windows specified desktop.
* Applies size checks, bounds, layout, etc...
* RETURN: Client * on Success.
* RETURN: NULL on Failure.
*/
Client *managereply(XCBWindow window, XCBCookie requests[ManageCookieLAST]);
Client *manage(XCBWindow window, void *replies[ManageClientLAST]);
/* Maximizes a client if unmaxed, Sets flag.
*/
void maximize(Client *c);
Expand Down
2 changes: 2 additions & 0 deletions include/getprop.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ enum PropertyType
PropPid,
PropIcon,
PropMotifHints,
PropManage,
PropUnmanage,

/* special */
PropExitThread,
Expand Down
Loading

0 comments on commit cd3b4ff

Please sign in to comment.