mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-07 01:49:47 +00:00
fix
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@84 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -186,7 +186,11 @@ void MwSetText(MwWidget handle, const char* key, const char* value) {
|
||||
}
|
||||
|
||||
void MwSetVoid(MwWidget handle, const char* key, void* value) {
|
||||
shput(handle->data, key, value);
|
||||
if(strcmp(key, MwNiconPixmap) == 0) {
|
||||
MwLLSetIcon(handle->lowlevel, value);
|
||||
} else {
|
||||
shput(handle->data, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
int MwGetInteger(MwWidget handle, const char* key) {
|
||||
|
||||
@@ -290,7 +290,7 @@ void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||
void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap) {
|
||||
unsigned long* icon = malloc((2 + pixmap->width * pixmap->height) * sizeof(*icon));
|
||||
int i;
|
||||
Atom atom = XInternAtom(lowlevel->display, "_NET_WM_ICON", False);
|
||||
Atom atom = XInternAtom(handle->display, "_NET_WM_ICON", False);
|
||||
|
||||
icon[0] = pixmap->width;
|
||||
icon[1] = pixmap->height;
|
||||
@@ -299,7 +299,7 @@ void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap) {
|
||||
icon[2 + i] = *(unsigned long*)(&pixmap->image->data[i * 4]);
|
||||
}
|
||||
|
||||
XChangeProperty(lowlevel->display, lowlevel->window, atom, 6, 32, PropModeReplace, (unsigned char*)icon, 2 + pixmap->width * pixmap->height);
|
||||
XChangeProperty(handle->display, handle->window, atom, 6, 32, PropModeReplace, (unsigned char*)icon, 2 + pixmap->width * pixmap->height);
|
||||
|
||||
free(icon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user