This commit is contained in:
Nishi 2025-12-25 15:47:38 +09:00
commit ec3bfc7aba
2 changed files with 5 additions and 6 deletions

View file

@ -20,7 +20,7 @@
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#define TitleBarHeight 16 #define TitleBarHeight 18
#define Gap 1 #define Gap 1
/* xserver.c */ /* xserver.c */

View file

@ -312,7 +312,9 @@ MwWidget wm_frame(int w, int h) {
MwAddUserHandler(f->titlebar, MwNmouseMoveHandler, drag, NULL); MwAddUserHandler(f->titlebar, MwNmouseMoveHandler, drag, NULL);
MwAddUserHandler(f->titlebar, MwNmouseDownHandler, drag_down, NULL); MwAddUserHandler(f->titlebar, MwNmouseDownHandler, drag_down, NULL);
f->title = MwCreateWidget(MwLabelClass, "title", f->titlebar, 0, 0, 0, 0); f->title = MwVaCreateWidget(MwLabelClass, "title", f->titlebar, 0, 0, 0, 0,
MwNleftPadding, 3,
NULL);
MwAddUserHandler(f->title, MwNmouseUpHandler, drag_up, NULL); MwAddUserHandler(f->title, MwNmouseUpHandler, drag_up, NULL);
MwAddUserHandler(f->title, MwNmouseMoveHandler, drag, NULL); MwAddUserHandler(f->title, MwNmouseMoveHandler, drag, NULL);
MwAddUserHandler(f->title, MwNmouseDownHandler, drag_down, NULL); MwAddUserHandler(f->title, MwNmouseDownHandler, drag_down, NULL);
@ -366,15 +368,12 @@ void wm_destroy(MwWidget widget) {
void wm_set_name(MwWidget widget, const char* name) { void wm_set_name(MwWidget widget, const char* name) {
wmframe_t* f = widget->opaque; wmframe_t* f = widget->opaque;
char* s = MDEStringConcatenate(" ", name);
pthread_mutex_lock(&xmutex); pthread_mutex_lock(&xmutex);
MwVaApply(f->title, MwVaApply(f->title,
MwNtext, s, MwNtext, name,
NULL); NULL);
pthread_mutex_unlock(&xmutex); pthread_mutex_unlock(&xmutex);
free(s);
} }
static char tmp_bg[64]; static char tmp_bg[64];