update
This commit is contained in:
parent
9557912dcc
commit
1647490b5a
4 changed files with 52 additions and 52 deletions
|
|
@ -96,7 +96,7 @@ static int conversation(int num_msg, const struct pam_message** msg, struct pam_
|
|||
|
||||
for(i = 0; i < num_msg; i++) {
|
||||
if(msg[i]->msg_style == PAM_PROMPT_ECHO_OFF) {
|
||||
const char* txt = MwGetText(passentry, MwNtext);
|
||||
const char* txt = MwGetString(passentry, MwNtext);
|
||||
if(txt == NULL) txt = "";
|
||||
|
||||
resp[i]->resp_retcode = PAM_SUCCESS;
|
||||
|
|
@ -154,11 +154,11 @@ cleanup:
|
|||
err2 = pam_end(pam, 0);
|
||||
|
||||
if(err && ret != PAM_SUCCESS) {
|
||||
MwSetText(passentry, MwNtext, "");
|
||||
MwSetString(passentry, MwNtext, "");
|
||||
snprintf(err_str, 255, "%s: %s", place, pam_strerror(pam, err));
|
||||
print_error = 1;
|
||||
} else if(err2) {
|
||||
MwSetText(passentry, MwNtext, "");
|
||||
MwSetString(passentry, MwNtext, "");
|
||||
snprintf(err_str, 255, "Error calling pam_end: %s", pam_strerror(pam, err2));
|
||||
print_error = 1;
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ cleanup:
|
|||
}
|
||||
}
|
||||
|
||||
MwSetText(reason, MwNtext, "Login failed");
|
||||
MwSetString(reason, MwNtext, "Login failed");
|
||||
} else {
|
||||
printf("Logging in as %s\n", username);
|
||||
struct passwd* pwd = getpwnam(username);
|
||||
|
|
|
|||
62
milkwm/wm.c
62
milkwm/wm.c
|
|
@ -16,14 +16,14 @@ typedef struct wmframe {
|
|||
|
||||
MwWidget menu_button;
|
||||
|
||||
MwLLPixmap maximize;
|
||||
MwLLPixmap restore;
|
||||
MwLLPixmap iconify;
|
||||
MwPixmap maximize;
|
||||
MwPixmap restore;
|
||||
MwPixmap iconify;
|
||||
|
||||
int dragging;
|
||||
MwPoint drag_point;
|
||||
|
||||
MwLLPixmap background;
|
||||
MwPixmap background;
|
||||
|
||||
int maximized;
|
||||
MwRect old_size;
|
||||
|
|
@ -255,13 +255,13 @@ static void menu_menu(MwWidget handle, void* user, void* client) {
|
|||
|
||||
if(strcmp(m->name, "Maximize") == 0 || strcmp(m->name, "Restore") == 0) {
|
||||
for(i = 0; i < arrlen(f->left); i++) {
|
||||
MwLLPixmap px = MwGetVoid(f->left[i], MwNpixmap);
|
||||
MwPixmap px = MwGetPointer(f->left[i], MwNpixmap);
|
||||
|
||||
if(px == f->maximize || px == f->restore) maximize(f->left[i], w, NULL);
|
||||
}
|
||||
|
||||
for(i = 0; i < arrlen(f->right); i++) {
|
||||
MwLLPixmap px = MwGetVoid(f->right[i], MwNpixmap);
|
||||
MwPixmap px = MwGetPointer(f->right[i], MwNpixmap);
|
||||
|
||||
if(px == f->maximize || px == f->restore) maximize(f->right[i], w, NULL);
|
||||
}
|
||||
|
|
@ -278,7 +278,7 @@ static void menu_menu(MwWidget handle, void* user, void* client) {
|
|||
static void apply_button(MwWidget widget, const char* str) {
|
||||
MwWidget w = widget;
|
||||
wmframe_t* f;
|
||||
MwLLPixmap px = NULL;
|
||||
MwPixmap px = NULL;
|
||||
|
||||
while(w != NULL && strcmp(MwGetName(w), "frame") != 0) w = MwGetParent(w);
|
||||
|
||||
|
|
@ -558,10 +558,10 @@ void wm_destroy(MwWidget widget) {
|
|||
arrfree(f->left);
|
||||
arrfree(f->right);
|
||||
|
||||
if(f->background != NULL) MwLLDestroyPixmap(f->background);
|
||||
MwLLDestroyPixmap(f->maximize);
|
||||
MwLLDestroyPixmap(f->restore);
|
||||
MwLLDestroyPixmap(f->iconify);
|
||||
if(f->background != NULL) MwDestroyPixmap(f->background);
|
||||
MwDestroyPixmap(f->maximize);
|
||||
MwDestroyPixmap(f->restore);
|
||||
MwDestroyPixmap(f->iconify);
|
||||
free(widget->opaque);
|
||||
MwDestroyWidget(widget);
|
||||
pthread_mutex_unlock(&xmutex);
|
||||
|
|
@ -579,15 +579,15 @@ void wm_set_name(MwWidget widget, const char* name) {
|
|||
|
||||
int wm_set_icon_by_name(MwWidget widget, const char* cat, const char* name) {
|
||||
wmframe_t* f = widget->opaque;
|
||||
MwLLPixmap px = NULL;
|
||||
MwPixmap px = NULL;
|
||||
int st = 0;
|
||||
|
||||
pthread_mutex_lock(&xmutex);
|
||||
if(f->menu_button != NULL) {
|
||||
char* p;
|
||||
|
||||
if((px = MwGetVoid(f->menu_button, MwNpixmap)) != NULL) {
|
||||
MwLLDestroyPixmap(px);
|
||||
if((px = MwGetPointer(f->menu_button, MwNpixmap)) != NULL) {
|
||||
MwDestroyPixmap(px);
|
||||
px = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ int wm_set_icon_by_name(MwWidget widget, const char* cat, const char* name) {
|
|||
free(p);
|
||||
}
|
||||
|
||||
MwSetVoid(f->menu_button, MwNpixmap, px);
|
||||
MwSetPointer(f->menu_button, MwNpixmap, px);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&xmutex);
|
||||
|
|
@ -609,27 +609,27 @@ int wm_set_icon_by_name(MwWidget widget, const char* cat, const char* name) {
|
|||
|
||||
void wm_set_icon(MwWidget widget, unsigned char* data, int width, int height) {
|
||||
wmframe_t* f = widget->opaque;
|
||||
MwLLPixmap px = NULL;
|
||||
MwPixmap px = NULL;
|
||||
|
||||
pthread_mutex_lock(&xmutex);
|
||||
if(f->menu_button != NULL) {
|
||||
if((px = MwGetVoid(f->menu_button, MwNpixmap)) != NULL) {
|
||||
MwLLDestroyPixmap(px);
|
||||
if((px = MwGetPointer(f->menu_button, MwNpixmap)) != NULL) {
|
||||
MwDestroyPixmap(px);
|
||||
px = NULL;
|
||||
}
|
||||
|
||||
px = MwLoadRaw(f->menu_button, data, width, height);
|
||||
|
||||
MwSetVoid(f->menu_button, MwNpixmap, px);
|
||||
MwSetPointer(f->menu_button, MwNpixmap, px);
|
||||
}
|
||||
pthread_mutex_unlock(&xmutex);
|
||||
}
|
||||
|
||||
static char tmp_bg[64];
|
||||
|
||||
MwLLPixmap lookup_col(MwWidget widget, const char* bgfg, const char* type, const char** bg) {
|
||||
MwPixmap lookup_col(MwWidget widget, const char* bgfg, const char* type, const char** bg) {
|
||||
wmframe_t* f = widget->opaque;
|
||||
MwLLPixmap px = NULL;
|
||||
MwPixmap px = NULL;
|
||||
xl_node_t* node = get_window();
|
||||
xl_node_t* n;
|
||||
|
||||
|
|
@ -651,8 +651,8 @@ MwLLPixmap lookup_col(MwWidget widget, const char* bgfg, const char* type, const
|
|||
const char* to;
|
||||
int i;
|
||||
unsigned char* d = malloc(1 * TitleBarHeight * 4);
|
||||
MwLLColor cfrom;
|
||||
MwLLColor cto;
|
||||
MwColor cfrom;
|
||||
MwColor cto;
|
||||
int fr, fg, fb;
|
||||
int tr, tg, tb;
|
||||
xl_node_t* n3 = n2->first_child;
|
||||
|
|
@ -680,12 +680,12 @@ MwLLPixmap lookup_col(MwWidget widget, const char* bgfg, const char* type, const
|
|||
continue;
|
||||
}
|
||||
|
||||
cfrom = MwParseColor(widget, from == NULL ? MwGetText(widget, MwNbackground) : from);
|
||||
cto = MwParseColor(widget, to == NULL ? MwGetText(widget, MwNbackground) : to);
|
||||
cfrom = MwParseColor(widget, from == NULL ? MwGetString(widget, MwNbackground) : from);
|
||||
cto = MwParseColor(widget, to == NULL ? MwGetString(widget, MwNbackground) : to);
|
||||
MwColorGet(cfrom, &fr, &fg, &fb);
|
||||
MwColorGet(cto, &tr, &tg, &tb);
|
||||
MwLLFreeColor(cfrom);
|
||||
MwLLFreeColor(cto);
|
||||
MwFreeColor(cfrom);
|
||||
MwFreeColor(cto);
|
||||
|
||||
memset(d, 255, 1 * TitleBarHeight * 4);
|
||||
|
||||
|
|
@ -716,8 +716,8 @@ void wm_focus(MwWidget widget, int focus) {
|
|||
wmframe_t* f = widget->opaque;
|
||||
const char* bg = NULL;
|
||||
const char* fg = NULL;
|
||||
MwLLPixmap bgpx = NULL;
|
||||
MwLLPixmap fgpx = NULL;
|
||||
MwPixmap bgpx = NULL;
|
||||
MwPixmap fgpx = NULL;
|
||||
|
||||
pthread_mutex_lock(&xmutex);
|
||||
if(focus) {
|
||||
|
|
@ -728,9 +728,9 @@ void wm_focus(MwWidget widget, int focus) {
|
|||
fgpx = lookup_col(widget, "Foreground", "Inactive", &fg);
|
||||
}
|
||||
|
||||
if(fgpx != NULL) MwLLDestroyPixmap(fgpx);
|
||||
if(fgpx != NULL) MwDestroyPixmap(fgpx);
|
||||
|
||||
if(f->background != NULL) MwLLDestroyPixmap(f->background);
|
||||
if(f->background != NULL) MwDestroyPixmap(f->background);
|
||||
f->background = bgpx;
|
||||
|
||||
MwVaApply(f->title,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ static int calc_size(MwWidget box, xl_node_t* node) {
|
|||
}
|
||||
|
||||
static void exec_button(MwWidget handle, void* user, void* client) {
|
||||
char** args = MDEStringToExec(MwGetText(handle, "Sexec"), NULL);
|
||||
char** args = MDEStringToExec(MwGetString(handle, "Sexec"), NULL);
|
||||
int i;
|
||||
|
||||
if(fork() == 0) {
|
||||
|
|
@ -55,7 +55,7 @@ void module_reload(MwWidget box, MwWidget user, xl_node_t* node) {
|
|||
if(children != NULL) {
|
||||
int i;
|
||||
for(i = 0; children[i] != NULL; i++) {
|
||||
MwLLPixmap px = MwGetVoid(children[i], MwNpixmap);
|
||||
MwLLPixmap px = MwGetPointer(children[i], MwNpixmap);
|
||||
|
||||
if(px != NULL) MwLLDestroyPixmap(px);
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ void module_destroy(MwWidget box, MwWidget user) {
|
|||
if(children != NULL) {
|
||||
int i;
|
||||
for(i = 0; children[i] != NULL; i++) {
|
||||
MwLLPixmap px = MwGetVoid(children[i], MwNpixmap);
|
||||
MwLLPixmap px = MwGetPointer(children[i], MwNpixmap);
|
||||
|
||||
if(px != NULL) MwLLDestroyPixmap(px);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@
|
|||
#define TriW 5
|
||||
|
||||
typedef struct opaque {
|
||||
MwLLPixmap closed;
|
||||
MwLLPixmap opened;
|
||||
MwWidget submenu;
|
||||
int is_opened;
|
||||
MwMenu menu;
|
||||
MwMenu current;
|
||||
MwPixmap closed;
|
||||
MwPixmap opened;
|
||||
MwWidget submenu;
|
||||
int is_opened;
|
||||
MwMenu menu;
|
||||
MwMenu current;
|
||||
|
||||
MwLLPixmap stripe;
|
||||
char* stripe_color;
|
||||
MwPixmap stripe;
|
||||
char* stripe_color;
|
||||
|
||||
char* name;
|
||||
char* category;
|
||||
|
|
@ -367,7 +367,7 @@ void module_reload(MwWidget box, MwWidget user, xl_node_t* node) {
|
|||
} else if(n->type == XL_NODE_NODE && strcmp(n->name, "Stripe") == 0) {
|
||||
xl_attribute_t* a;
|
||||
|
||||
if(opaque->stripe != NULL) MwLLDestroyPixmap(opaque->stripe);
|
||||
if(opaque->stripe != NULL) MwDestroyPixmap(opaque->stripe);
|
||||
opaque->stripe = MwLoadImage(box, n->text == NULL ? "" : n->text);
|
||||
|
||||
a = n->first_attribute;
|
||||
|
|
@ -394,8 +394,8 @@ void module_reload(MwWidget box, MwWidget user, xl_node_t* node) {
|
|||
}
|
||||
|
||||
MwWidget module(MwWidget box, xl_node_t* node) {
|
||||
MwLLPixmap closed = NULL;
|
||||
MwLLPixmap opened = NULL;
|
||||
MwPixmap closed = NULL;
|
||||
MwPixmap opened = NULL;
|
||||
MwWidget btn;
|
||||
int w, h;
|
||||
unsigned int ch;
|
||||
|
|
@ -477,10 +477,10 @@ MwWidget module(MwWidget box, xl_node_t* node) {
|
|||
void module_destroy(MwWidget box, MwWidget user) {
|
||||
opaque_t* opaque = user->opaque;
|
||||
|
||||
MwLLDestroyPixmap(opaque->closed);
|
||||
MwLLDestroyPixmap(opaque->opened);
|
||||
MwDestroyPixmap(opaque->closed);
|
||||
MwDestroyPixmap(opaque->opened);
|
||||
|
||||
if(opaque->stripe != NULL) MwLLDestroyPixmap(opaque->stripe);
|
||||
if(opaque->stripe != NULL) MwDestroyPixmap(opaque->stripe);
|
||||
if(opaque->stripe_color != NULL) free(opaque->stripe_color);
|
||||
|
||||
recursive_free(opaque->menu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue