From 4c90d1d9e4092f9ee0106d316829144653a276ea Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Tue, 30 Dec 2025 02:45:11 +0100 Subject: Split monolithic dwm.h into modular headers and group them by it's functionalities The new plan of refactoring this project is to split entire monolithic codebase into separate, (kind of) independent modules. This will help with understanding the code by turning off modules and deciding which ones require some work. Signed-off-by: Filip Wandzio --- src/transient/transient.c | 90 ----------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 src/transient/transient.c (limited to 'src/transient') diff --git a/src/transient/transient.c b/src/transient/transient.c deleted file mode 100644 index fed0f77..0000000 --- a/src/transient/transient.c +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include -#include -#include - -#define FLOATING_WINDOW_WIDTH 400 -#define FLOATING_WINDOW_HEIGHT 400 -#define FLOATING_WINDOW_X_POS 100 -#define FLOATING_WINDOW_Y_POS 100 - -#define TRANSIENT_WINDOW_WIDTH 100 -#define TRANSIENT_WINDOW_HEIGHT 100 -#define TRANSIENT_WINDOW_X_POS 50 -#define TRANSIENT_WINDOW_Y_POS 50 - -#define SLEEP_TIME 5 - -#define WINDOW_BORDER_WIDTH 0 -#define WINDOW_BORDER_COLOR 0 -#define WINDOW_BACKGROUND_COLOR 0 - -/** - * @brief Function that creates and manages floating and transient window. - * - * This program opens an X display, creates a floating window with specific - * size and position, and then creates a transient (child) window after a - * specified delay. The transient window is always associated with the - * floating window, meaning it will behave as a child of the floating window. - * The program uses Xlib to interact with the X server, handle events, and - * manage window properties such as size, title, and position. - * - * The key steps are: - * 1. Create the floating window and set its size constraints. - * 2. After a delay (5 seconds), create the transient window and associate - * it with the floating window. - * 3. Display both windows on the screen. - * 4. Wait for and process X events in an infinite loop. This allows the - * windows to remain open and interact with the X server. - * - * @return int Exit status (always 0). - */ -int main(void) -{ - Display *display; - Window rootWindow, floatingWindow, transientWindow = None; - XSizeHints sizeHints; - XEvent event; - - display = XOpenDisplay(NULL); - if (!display) - exit(1); - - rootWindow = DefaultRootWindow(display); - - floatingWindow = XCreateSimpleWindow( - display, rootWindow, FLOATING_WINDOW_X_POS, FLOATING_WINDOW_Y_POS, - FLOATING_WINDOW_WIDTH, FLOATING_WINDOW_HEIGHT, WINDOW_BORDER_WIDTH, - WINDOW_BORDER_COLOR, WINDOW_BACKGROUND_COLOR); - - sizeHints.min_width = sizeHints.max_width = sizeHints.min_height = - sizeHints.max_height = FLOATING_WINDOW_WIDTH; - sizeHints.flags = PMinSize | PMaxSize; - XSetWMNormalHints(display, floatingWindow, &sizeHints); - XStoreName(display, floatingWindow, "floating"); - XMapWindow(display, floatingWindow); - XSelectInput(display, floatingWindow, ExposureMask); - - while (1) { - XNextEvent(display, &event); - - if (transientWindow == None) { - sleep(SLEEP_TIME); - - transientWindow = XCreateSimpleWindow( - display, rootWindow, TRANSIENT_WINDOW_X_POS, - TRANSIENT_WINDOW_Y_POS, TRANSIENT_WINDOW_WIDTH, - TRANSIENT_WINDOW_HEIGHT, WINDOW_BORDER_WIDTH, - WINDOW_BORDER_COLOR, WINDOW_BACKGROUND_COLOR); - - XSetTransientForHint(display, transientWindow, - floatingWindow); - XStoreName(display, transientWindow, "transient"); - XMapWindow(display, transientWindow); - XSelectInput(display, transientWindow, ExposureMask); - } - } - - XCloseDisplay(display); - exit(0); -} -- cgit v1.2.3