Fri Sep 24 13:05:40 PDT 1999 Michael Jennings <mej@eterm.org>
The submenu image problem is fixed, and so is the bug where Eterm would hang if you had anything in auto mode and restarted E. SVN revision: 392
This commit is contained in:
parent
c4163c0062
commit
5cf9f10625
|
@ -2488,3 +2488,9 @@ Thu Sep 23 17:15:27 PDT 1999 Michael Jennings <mej@eterm.org>
|
||||||
it keeps returning null pixmaps. =] I'll have to dig deeper.
|
it keeps returning null pixmaps. =] I'll have to dig deeper.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
Fri Sep 24 13:05:40 PDT 1999 Michael Jennings <mej@eterm.org>
|
||||||
|
|
||||||
|
The submenu image problem is fixed, and so is the bug where Eterm
|
||||||
|
would hang if you had anything in auto mode and restarted E.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
84
src/e.c
84
src/e.c
|
@ -33,6 +33,7 @@ static const char cvs_ident[] = "$Id$";
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "../libmej/debug.h"
|
#include "../libmej/debug.h"
|
||||||
#include "../libmej/mem.h"
|
#include "../libmej/mem.h"
|
||||||
|
@ -43,9 +44,11 @@ static const char cvs_ident[] = "$Id$";
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "pixmap.h"
|
#include "pixmap.h"
|
||||||
|
#include "system.h"
|
||||||
|
|
||||||
Window ipc_win = None;
|
Window ipc_win = None;
|
||||||
Atom ipc_atom = None;
|
Atom ipc_atom = None;
|
||||||
|
static unsigned char timeout = 0;
|
||||||
|
|
||||||
/* Returns true if running under E, false otherwise */
|
/* Returns true if running under E, false otherwise */
|
||||||
unsigned char
|
unsigned char
|
||||||
|
@ -55,10 +58,10 @@ check_for_enlightenment(void)
|
||||||
|
|
||||||
if (have_e == -1) {
|
if (have_e == -1) {
|
||||||
if (XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True) != None) {
|
if (XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True) != None) {
|
||||||
D_X11(("Enlightenment detected.\n"));
|
D_ENL(("Enlightenment detected.\n"));
|
||||||
have_e = 1;
|
have_e = 1;
|
||||||
} else {
|
} else {
|
||||||
D_X11(("Enlightenment not detected.\n"));
|
D_ENL(("Enlightenment not detected.\n"));
|
||||||
have_e = 0;
|
have_e = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,8 +80,11 @@ enl_ipc_get_win(void)
|
||||||
int dummy_int;
|
int dummy_int;
|
||||||
unsigned int dummy_uint;
|
unsigned int dummy_uint;
|
||||||
|
|
||||||
|
D_ENL(("enl_ipc_get_win(): Searching for IPC window.\n"));
|
||||||
|
|
||||||
prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
|
prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
|
||||||
if (prop == None) {
|
if (prop == None) {
|
||||||
|
D_ENL((" -> Enlightenment is not running. You lose!\n"));
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
XGetWindowProperty(Xdisplay, Xroot, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
|
XGetWindowProperty(Xdisplay, Xroot, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
|
||||||
|
@ -88,6 +94,7 @@ enl_ipc_get_win(void)
|
||||||
}
|
}
|
||||||
if (ipc_win != None) {
|
if (ipc_win != None) {
|
||||||
if (!XGetGeometry(Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) {
|
if (!XGetGeometry(Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) {
|
||||||
|
D_ENL((" -> IPC Window property is valid, but the window doesn't exist. I give up!\n"));
|
||||||
ipc_win = None;
|
ipc_win = None;
|
||||||
}
|
}
|
||||||
str = NULL;
|
str = NULL;
|
||||||
|
@ -96,11 +103,13 @@ enl_ipc_get_win(void)
|
||||||
if (str) {
|
if (str) {
|
||||||
XFree(str);
|
XFree(str);
|
||||||
} else {
|
} else {
|
||||||
|
D_ENL((" -> IPC Window lacks the proper atom. I can't talk to fake IPC windows....\n"));
|
||||||
ipc_win = None;
|
ipc_win = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ipc_win != None) {
|
if (ipc_win != None) {
|
||||||
|
D_ENL((" -> IPC Window found and verified as 0x%08x. Registering Eterm as an IPC client.\n", (int) ipc_win));
|
||||||
XSelectInput(Xdisplay, ipc_win, StructureNotifyMask | SubstructureNotifyMask);
|
XSelectInput(Xdisplay, ipc_win, StructureNotifyMask | SubstructureNotifyMask);
|
||||||
enl_ipc_send("set clientname " APL_NAME);
|
enl_ipc_send("set clientname " APL_NAME);
|
||||||
enl_ipc_send("set version " VERSION);
|
enl_ipc_send("set version " VERSION);
|
||||||
|
@ -115,19 +124,28 @@ void
|
||||||
enl_ipc_send(char *str)
|
enl_ipc_send(char *str)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static char *last_msg = NULL;
|
||||||
char buff[21];
|
char buff[21];
|
||||||
register unsigned short i;
|
register unsigned short i;
|
||||||
register unsigned char j;
|
register unsigned char j;
|
||||||
unsigned short len;
|
unsigned short len;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
ASSERT(str != NULL);
|
if (str == NULL) {
|
||||||
|
ASSERT(last_msg != NULL);
|
||||||
D_ENL(("enl_ipc_send(): Sending \"%s\" to Enlightenment.\n", str));
|
str = last_msg;
|
||||||
|
D_ENL(("enl_ipc_send(): Resending last message \"%s\" to Enlightenment.\n", str));
|
||||||
|
} else {
|
||||||
|
if (last_msg != NULL) {
|
||||||
|
FREE(last_msg);
|
||||||
|
}
|
||||||
|
last_msg = StrDup(str);
|
||||||
|
D_ENL(("enl_ipc_send(): Sending \"%s\" to Enlightenment.\n", str));
|
||||||
|
}
|
||||||
|
|
||||||
if (ipc_win == None) {
|
if (ipc_win == None) {
|
||||||
if ((ipc_win = enl_ipc_get_win()) == None) {
|
if ((ipc_win = enl_ipc_get_win()) == None) {
|
||||||
D_ENL((" ...or perhaps not, since Enlightenment doesn't seem to be running. No IPC window, no IPC. Sorry....\n"));
|
D_ENL(("enl_ipc_send(): ...or perhaps not, since Enlightenment doesn't seem to be running. No IPC window, no IPC. Sorry....\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +176,14 @@ enl_ipc_send(char *str)
|
||||||
}
|
}
|
||||||
XSendEvent(Xdisplay, ipc_win, False, 0, (XEvent *) & ev);
|
XSendEvent(Xdisplay, ipc_win, False, 0, (XEvent *) & ev);
|
||||||
}
|
}
|
||||||
D_ENL(("enl_ipc_send(): Message sent.\n"));
|
D_ENL(("enl_ipc_send(): Message sent to IPC window 0x%08x.\n", ipc_win));
|
||||||
|
}
|
||||||
|
|
||||||
|
static RETSIGTYPE
|
||||||
|
enl_ipc_timeout(int sig)
|
||||||
|
{
|
||||||
|
timeout = 1;
|
||||||
|
return ((RETSIGTYPE) sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -169,7 +194,12 @@ enl_wait_for_reply(void)
|
||||||
static char msg_buffer[20];
|
static char msg_buffer[20];
|
||||||
register unsigned char i;
|
register unsigned char i;
|
||||||
|
|
||||||
for (; !XCheckTypedWindowEvent(Xdisplay, TermWin.parent, ClientMessage, &ev););
|
alarm(3);
|
||||||
|
for (; !XCheckTypedWindowEvent(Xdisplay, TermWin.parent, ClientMessage, &ev) && !timeout;);
|
||||||
|
alarm(0);
|
||||||
|
if (ev.xany.type != ClientMessage) {
|
||||||
|
return (IPC_TIMEOUT);
|
||||||
|
}
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
msg_buffer[i] = ev.xclient.data.b[i];
|
msg_buffer[i] = ev.xclient.data.b[i];
|
||||||
}
|
}
|
||||||
|
@ -186,6 +216,9 @@ enl_ipc_get(const char *msg_data)
|
||||||
register unsigned char i;
|
register unsigned char i;
|
||||||
unsigned char blen;
|
unsigned char blen;
|
||||||
|
|
||||||
|
if (msg_data == IPC_TIMEOUT) {
|
||||||
|
return (IPC_TIMEOUT);
|
||||||
|
}
|
||||||
for (i = 0; i < 12; i++) {
|
for (i = 0; i < 12; i++) {
|
||||||
buff[i] = msg_data[i];
|
buff[i] = msg_data[i];
|
||||||
}
|
}
|
||||||
|
@ -208,17 +241,33 @@ enl_ipc_get(const char *msg_data)
|
||||||
return (ret_msg);
|
return (ret_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
char *
|
||||||
enl_query_for_image(unsigned char type)
|
enl_send_and_wait(char *msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
char query[255], *filename;
|
char *reply = IPC_TIMEOUT;
|
||||||
|
sighandler_t old_alrm;
|
||||||
|
|
||||||
snprintf(query, sizeof(query), "insert correct IPC command here");
|
if (ipc_win == None) {
|
||||||
enl_ipc_send("");
|
/* The IPC window is missing. Wait for it to return or Eterm to be killed. */
|
||||||
for (; !(filename = enl_ipc_get(enl_wait_for_reply())););
|
for (; enl_ipc_get_win() == None;) {
|
||||||
/* Extract filename */
|
sleep(1);
|
||||||
load_image(filename, type);
|
}
|
||||||
|
}
|
||||||
|
old_alrm = (sighandler_t) signal(SIGALRM, (sighandler_t) enl_ipc_timeout);
|
||||||
|
for (; reply == IPC_TIMEOUT;) {
|
||||||
|
timeout = 0;
|
||||||
|
enl_ipc_send(msg);
|
||||||
|
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
||||||
|
if (reply == IPC_TIMEOUT) {
|
||||||
|
/* We timed out. The IPC window must be AWOL. Reset and resend message. */
|
||||||
|
D_ENL(("enl_wait_for_reply(): IPC timed out. IPC window 0x%08x has gone AWOL. Clearing ipc_win.\n", ipc_win));
|
||||||
|
XSelectInput(Xdisplay, ipc_win, None);
|
||||||
|
ipc_win = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
signal(SIGALRM, old_alrm);
|
||||||
|
return (reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -255,8 +304,7 @@ eterm_ipc_parse(char *str)
|
||||||
if (params) {
|
if (params) {
|
||||||
char *reply, header[512];
|
char *reply, header[512];
|
||||||
|
|
||||||
enl_ipc_send(params);
|
reply = enl_send_and_wait(params);
|
||||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
|
||||||
snprintf(header, sizeof(header), "Enlightenment IPC Reply to \"%s\":\n\n", params);
|
snprintf(header, sizeof(header), "Enlightenment IPC Reply to \"%s\":\n\n", params);
|
||||||
tt_write(header, strlen(header));
|
tt_write(header, strlen(header));
|
||||||
tt_write(reply, strlen(reply));
|
tt_write(reply, strlen(reply));
|
||||||
|
|
1
src/e.h
1
src/e.h
|
@ -32,6 +32,7 @@
|
||||||
#include "pixmap.h" /* For simage_t */
|
#include "pixmap.h" /* For simage_t */
|
||||||
|
|
||||||
/************ Macros and Definitions ************/
|
/************ Macros and Definitions ************/
|
||||||
|
#define IPC_TIMEOUT ((char *) 1)
|
||||||
|
|
||||||
/************ Variables ************/
|
/************ Variables ************/
|
||||||
extern Window ipc_win;
|
extern Window ipc_win;
|
||||||
|
|
49
src/events.c
49
src/events.c
|
@ -234,28 +234,39 @@ handle_property_notify(event_t * ev)
|
||||||
if ((ev->xany.window == TermWin.parent) || (ev->xany.window == Xroot)) {
|
if ((ev->xany.window == TermWin.parent) || (ev->xany.window == Xroot)) {
|
||||||
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", True);
|
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", True);
|
||||||
D_EVENTS(("handle_property_notify(): On %s. prop == 0x%08x, ev->xproperty.atom == 0x%08x\n", ((ev->xany.window == Xroot) ? "the root window" : "TermWin.parent"), (int) prop, (int) ev->xproperty.atom));
|
D_EVENTS(("handle_property_notify(): On %s. prop == 0x%08x, ev->xproperty.atom == 0x%08x\n", ((ev->xany.window == Xroot) ? "the root window" : "TermWin.parent"), (int) prop, (int) ev->xproperty.atom));
|
||||||
if ((prop == None) || (ev->xproperty.atom != prop)) {
|
if (ev->xproperty.atom == prop) {
|
||||||
return 0;
|
if (desktop_pixmap != None) {
|
||||||
}
|
free_desktop_pixmap();
|
||||||
if (desktop_pixmap != None) {
|
}
|
||||||
free_desktop_pixmap();
|
desktop_window = get_desktop_window();
|
||||||
}
|
if (desktop_window == None) {
|
||||||
desktop_window = get_desktop_window();
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
|
||||||
if (desktop_window == None) {
|
return 1;
|
||||||
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
|
}
|
||||||
|
redraw_all_images();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
redraw_all_images();
|
}
|
||||||
} else if (ev->xany.window == desktop_window) {
|
if (ev->xany.window == desktop_window) {
|
||||||
prop = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
|
prop = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
|
||||||
D_EVENTS(("handle_property_notify(): On TermWin.parent. prop == 0x%08x, ev->xproperty.atom == 0x%08x\n", (int) prop, (int) ev->xproperty.atom));
|
D_EVENTS(("handle_property_notify(): On desktop_window [0x%08x]. prop == 0x%08x, ev->xproperty.atom == 0x%08x\n", (int) desktop_window, (int) prop, (int) ev->xproperty.atom));
|
||||||
if ((prop == None) || (ev->xproperty.atom != prop)) {
|
if (ev->xproperty.atom == prop) {
|
||||||
return 0;
|
if (desktop_pixmap != None) {
|
||||||
|
free_desktop_pixmap();
|
||||||
|
}
|
||||||
|
redraw_all_images();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
if (desktop_pixmap != None) {
|
}
|
||||||
free_desktop_pixmap();
|
}
|
||||||
}
|
if ((ev->xany.window == Xroot) || (ev->xany.window == ipc_win)) {
|
||||||
redraw_all_images();
|
prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
|
||||||
|
D_EVENTS(("handle_property_notify(): On 0x%08x. prop == 0x%08x, ev->xproperty.atom == 0x%08x\n", (int) ev->xany.window, (int) prop, (int) ev->xproperty.atom));
|
||||||
|
if (ev->xproperty.atom == prop) {
|
||||||
|
D_EVENTS((" -> IPC window 0x%08x changed/destroyed. Clearing ipc_win.\n", ipc_win));
|
||||||
|
XSelectInput(Xdisplay, ipc_win, None);
|
||||||
|
ipc_win = None;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -268,6 +279,8 @@ handle_destroy_notify(event_t * ev)
|
||||||
D_EVENTS(("handle_destroy_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
D_EVENTS(("handle_destroy_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||||
|
|
||||||
if (ev->xany.window == ipc_win) {
|
if (ev->xany.window == ipc_win) {
|
||||||
|
D_EVENTS((" -> IPC window 0x%08x changed/destroyed. Clearing ipc_win.\n", ipc_win));
|
||||||
|
XSelectInput(Xdisplay, ipc_win, None);
|
||||||
ipc_win = None;
|
ipc_win = None;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
24
src/pixmap.c
24
src/pixmap.c
|
@ -350,8 +350,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
|
||||||
|
|
||||||
if (iclass) {
|
if (iclass) {
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s query", iclass);
|
snprintf(buff, sizeof(buff), "imageclass %s query", iclass);
|
||||||
enl_ipc_send(buff);
|
reply = enl_send_and_wait(buff);
|
||||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
|
||||||
if (strstr(reply, "not")) {
|
if (strstr(reply, "not")) {
|
||||||
print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
||||||
if (image_mode_is(which, ALLOW_IMAGE)) {
|
if (image_mode_is(which, ALLOW_IMAGE)) {
|
||||||
|
@ -359,14 +358,16 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
|
||||||
} else {
|
} else {
|
||||||
image_set_mode(which, MODE_SOLID);
|
image_set_mode(which, MODE_SOLID);
|
||||||
}
|
}
|
||||||
|
FREE(reply);
|
||||||
} else if (strstr(reply, "Error")) {
|
} else if (strstr(reply, "Error")) {
|
||||||
print_error("Looks like this version of Enlightenment doesn't support the IPC commands I need. Disallowing \"auto\" mode for all images.\n");
|
print_error("Looks like this version of Enlightenment doesn't support the IPC commands I need. Disallowing \"auto\" mode for all images.\n");
|
||||||
FOREACH_IMAGE(if (image_mode_is(idx, MODE_AUTO)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} else {image_set_mode(idx, MODE_SOLID);}} \
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_AUTO)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} else {image_set_mode(idx, MODE_SOLID);}} \
|
||||||
if (image_mode_is(idx, ALLOW_AUTO)) {image_disallow_mode(idx, ALLOW_AUTO);});
|
if (image_mode_is(idx, ALLOW_AUTO)) {image_disallow_mode(idx, ALLOW_AUTO);});
|
||||||
|
FREE(reply);
|
||||||
} else {
|
} else {
|
||||||
|
FREE(reply);
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s apply_copy 0x%x %s %hd %hd", iclass, (int) win, state, w, h);
|
snprintf(buff, sizeof(buff), "imageclass %s apply_copy 0x%x %s %hd %hd", iclass, (int) win, state, w, h);
|
||||||
enl_ipc_send(buff);
|
reply = enl_send_and_wait(buff);
|
||||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
|
||||||
if (strstr(reply, "Error")) {
|
if (strstr(reply, "Error")) {
|
||||||
print_error("Enlightenment didn't seem to like something about my syntax. Disallowing \"auto\" mode for this image.\n");
|
print_error("Enlightenment didn't seem to like something about my syntax. Disallowing \"auto\" mode for this image.\n");
|
||||||
if (image_mode_is(which, ALLOW_IMAGE)) {
|
if (image_mode_is(which, ALLOW_IMAGE)) {
|
||||||
|
@ -374,6 +375,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
|
||||||
} else {
|
} else {
|
||||||
image_set_mode(which, MODE_SOLID);
|
image_set_mode(which, MODE_SOLID);
|
||||||
}
|
}
|
||||||
|
FREE(reply);
|
||||||
} else {
|
} else {
|
||||||
GC gc;
|
GC gc;
|
||||||
XGCValues gcvalues;
|
XGCValues gcvalues;
|
||||||
|
@ -381,10 +383,13 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
|
||||||
gc = XCreateGC(Xdisplay, win, 0, &gcvalues);
|
gc = XCreateGC(Xdisplay, win, 0, &gcvalues);
|
||||||
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
|
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
|
||||||
mask = (Pixmap) strtoul(PWord(2, reply), (char **) NULL, 0);
|
mask = (Pixmap) strtoul(PWord(2, reply), (char **) NULL, 0);
|
||||||
|
FREE(reply);
|
||||||
if (pmap) {
|
if (pmap) {
|
||||||
if (mask) {
|
if (mask) {
|
||||||
shaped_window_apply_mask(pmap, mask);
|
shaped_window_apply_mask(pmap, mask);
|
||||||
}
|
}
|
||||||
|
XSetClipMask(Xdisplay, gc, mask);
|
||||||
|
XSetClipOrigin(Xdisplay, gc, x, y);
|
||||||
XCopyArea(Xdisplay, pmap, win, gc, 0, 0, w, h, x, y);
|
XCopyArea(Xdisplay, pmap, win, gc, 0, 0, w, h, x, y);
|
||||||
XFreePixmap(Xdisplay, pmap);
|
XFreePixmap(Xdisplay, pmap);
|
||||||
XFreePixmap(Xdisplay, mask);
|
XFreePixmap(Xdisplay, mask);
|
||||||
|
@ -392,6 +397,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, unsigned short x,
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
print_error("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
print_error("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
||||||
|
FREE(reply);
|
||||||
if (image_mode_is(which, ALLOW_IMAGE)) {
|
if (image_mode_is(which, ALLOW_IMAGE)) {
|
||||||
image_set_mode(which, MODE_IMAGE);
|
image_set_mode(which, MODE_IMAGE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -522,8 +528,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
}
|
}
|
||||||
if (iclass) {
|
if (iclass) {
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s query", iclass);
|
snprintf(buff, sizeof(buff), "imageclass %s query", iclass);
|
||||||
enl_ipc_send(buff);
|
reply = enl_send_and_wait(buff);
|
||||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
|
||||||
if (strstr(reply, "not")) {
|
if (strstr(reply, "not")) {
|
||||||
print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
||||||
if (image_mode_is(which, ALLOW_IMAGE)) {
|
if (image_mode_is(which, ALLOW_IMAGE)) {
|
||||||
|
@ -531,14 +536,17 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
||||||
} else {
|
} else {
|
||||||
image_set_mode(which, MODE_SOLID);
|
image_set_mode(which, MODE_SOLID);
|
||||||
}
|
}
|
||||||
|
FREE(reply);
|
||||||
} else if (strstr(reply, "Error")) {
|
} else if (strstr(reply, "Error")) {
|
||||||
print_error("Looks like this version of Enlightenment doesn't support the IPC commands I need. Disallowing \"auto\" mode for all images.\n");
|
print_error("Looks like this version of Enlightenment doesn't support the IPC commands I need. Disallowing \"auto\" mode for all images.\n");
|
||||||
FOREACH_IMAGE(if (image_mode_is(idx, MODE_AUTO)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} else {image_set_mode(idx, MODE_SOLID);}} \
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_AUTO)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} else {image_set_mode(idx, MODE_SOLID);}} \
|
||||||
if (image_mode_is(idx, ALLOW_AUTO)) {image_disallow_mode(idx, ALLOW_AUTO);});
|
if (image_mode_is(idx, ALLOW_AUTO)) {image_disallow_mode(idx, ALLOW_AUTO);});
|
||||||
|
FREE(reply);
|
||||||
} else {
|
} else {
|
||||||
|
FREE(reply);
|
||||||
snprintf(buff, sizeof(buff), "imageclass %s apply 0x%x %s", iclass, (int) win, state);
|
snprintf(buff, sizeof(buff), "imageclass %s apply 0x%x %s", iclass, (int) win, state);
|
||||||
enl_ipc_send(buff);
|
reply = enl_send_and_wait(buff);
|
||||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
FREE(reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue