Fix server grabbing issues. Don't use ecore_x API for trivial stuff.

SVN revision: 14642
This commit is contained in:
Kim Woelders 2005-05-07 11:20:02 +00:00
parent 6f0e788b63
commit 42c43d2aca
39 changed files with 154 additions and 149 deletions

View File

@ -2248,6 +2248,11 @@ void WindowMatchEwinOps(EWin * ewin);
Display *EDisplayOpen(const char *dstr, int scr);
void EDisplayClose(void);
void EDisplayDisconnect(void);
void EGrabServer(void);
void EUngrabServer(void);
int EServerIsGrabbed(void);
void EFlush(void);
void ESync(void);
void ERegisterWindow(Window win);
void EUnregisterWindow(Window win);
@ -2349,4 +2354,3 @@ extern EMode Mode;
#define FILEPATH_LEN_MAX 4096
#include "emodule.h"
#include "ecore-e16.h"

View File

@ -258,7 +258,7 @@ SetCurrentArea(int ax, int ay)
/* set hints up for it */
HintsSetDesktopViewport();
ecore_x_sync();
ESync();
ActionsResume();

View File

@ -654,7 +654,7 @@ BackgroundApply(Background * bg, Window win, int setbg)
XSetForeground(disp, gc, bg->bg_solid.pixel);
XFillRectangle(disp, win, gc, 0, 0, rw, rh);
}
ecore_x_sync();
ESync();
}
if (gc)

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
struct _client
{

View File

@ -100,7 +100,7 @@ CoordsShow(EWin * ewin)
ImageclassApply(ic, eo->win, cw, ch, 1, 0, STATE_NORMAL, 0, ST_UNKNWN);
TextclassApply(ic, eo->win, cw, ch, 0, 0, STATE_NORMAL, 0, tc, s);
XFlush(disp);
EFlush();
}
void

View File

@ -1194,7 +1194,7 @@ DeskRaise(int desk)
HandleDrawQueue();
}
HintsSetCurrentDesktop();
ecore_x_sync();
ESync();
}
static void
@ -1224,7 +1224,7 @@ DeskLower(int desk)
HandleDrawQueue();
}
HintsSetCurrentDesktop();
ecore_x_sync();
ESync();
}
void

View File

@ -649,7 +649,7 @@ ShowDialog(Dialog * d)
if (!FindDialog(d->win))
AddItem(d, d->name, d->win, LIST_TYPE_DIALOG);
ecore_x_sync();
ESync();
DialogRedraw(d);
Mode.queue_up = pq;
}

View File

@ -143,8 +143,6 @@ DockIt(EWin * ewin)
XMapWindow(disp, ewin->client.icon_win);
}
ecore_x_ungrab();
ImageclassApply(ic, EoGetWin(ewin), ewin->client.w, ewin->client.h,
0, 0, STATE_NORMAL, 0, ST_BUTTON);
}

View File

@ -379,7 +379,7 @@ EDestroyPixImg(PixImg * pi)
{
if (!pi)
return;
ecore_x_sync();
ESync();
XShmDetach(disp, pi->shminfo);
shmdt(pi->shminfo->shmaddr);
shmctl(pi->shminfo->shmid, IPC_RMID, 0);
@ -515,7 +515,9 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
}
if ((w <= 0) || (h <= 0))
return;
ecore_x_sync();
ESync();
if (dst)
{
switch (dst->xim->bits_per_pixel)
@ -1196,7 +1198,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((!root_pi) || (!ewin_pi) || (!draw_pi))
{
Conf.movres.mode_move = 0;
ecore_x_ungrab();
EUngrabServer();
DrawEwinShape(ewin, Conf.movres.mode_move, x, y, w, h,
firstlast);
goto done;

View File

@ -49,36 +49,6 @@ extern Ecore_X_Atom ECORE_X_ATOM_NET_STARTUP_INFO;
#define _ecore_x_disp disp
#define ecore_x_init(dstr) \
disp = XOpenDisplay(dstr)
#define ecore_x_shutdown() \
XCloseDisplay(disp)
#define ecore_x_display_get() \
disp
#define ecore_x_sync() \
XSync(disp, False)
#define ecore_x_window_move(win, x, y) \
XMoveWindow(disp, win, x, y)
#define ecore_x_window_resize(win, w, h) \
XResizeWindow(disp, win, w, h)
#define ecore_x_window_move_resize(win, x, y, w, h) \
XMoveResizeWindow(disp, win, x, y, w, h)
#define ecore_x_pixmap_new(draw, w, h, dep) \
XCreatePixmap(disp, draw, w, h, dep)
#define ecore_x_pixmap_del(pmap) \
XFreePixmap(disp, pmap)
#define ecore_x_gc_new(draw) \
XCreateGC(disp, draw, 0, NULL);
#define ecore_x_gc_del(gc) \
XFreeGC(disp, gc)
void ecore_x_grab(void);
void ecore_x_ungrab(void);
int ecore_x_client_message32_send(Ecore_X_Window win,
Ecore_X_Atom type,
long mask,

View File

@ -22,6 +22,7 @@
*/
#include "E.h"
#include "ecompmgr.h"
#include "ecore-e16.h"
void
EobjSetDesk(EObj * eo, int desk)
@ -408,7 +409,7 @@ EobjSlideTo(EObj * eo, int fx, int fy, int tx, int ty, int speed)
{
int k, x, y;
ecore_x_grab();
EGrabServer();
ETimedLoopInit(0, 1024, speed);
for (k = 0; k <= 1024;)
@ -421,7 +422,7 @@ EobjSlideTo(EObj * eo, int fx, int fy, int tx, int ty, int speed)
}
EobjMove(eo, tx, ty);
ecore_x_ungrab();
EUngrabServer();
}
void

View File

@ -212,7 +212,7 @@ HandleEvent(XEvent * ev)
{
XSetInputFocus(disp, ev->xkey.root, RevertToPointerRoot,
CurrentTime);
ecore_x_sync();
ESync();
ev->xkey.time = CurrentTime;
XSendEvent(disp, ev->xkey.root, False, 0, ev);
}

View File

@ -101,7 +101,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
SoundPlay("SOUND_WINDOW_SLIDE");
if (Conf.slidemode > 0)
ecore_x_grab();
EGrabServer();
ETimedLoopInit(0, 1024, speed);
for (k = 0; k <= 1024;)
@ -125,7 +125,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
Mode.doingslide = 0;
if (Conf.slidemode > 0)
ecore_x_ungrab();
EUngrabServer();
SoundPlay("SOUND_WINDOW_SLIDE_END");
}
@ -148,7 +148,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
SoundPlay("SOUND_WINDOW_SLIDE");
if (Conf.slidemode > 0)
ecore_x_grab();
EGrabServer();
ETimedLoopInit(0, 1024, speed);
for (k = 0; k <= 1024;)
@ -187,7 +187,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
Mode.doingslide = 0;
if (Conf.slidemode > 0)
ecore_x_ungrab();
EUngrabServer();
SoundPlay("SOUND_WINDOW_SLIDE_END");
@ -798,7 +798,7 @@ EwinInstantShade(EWin * ewin, int force)
EoMoveResize(ewin, x, y, w, h);
EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
EwinBorderCalcSizes(ewin);
ecore_x_sync();
ESync();
EwinPropagateShapes(ewin);
Mode.queue_up = pq;
@ -864,7 +864,7 @@ EwinInstantUnShade(EWin * ewin)
ewin->shaded = 0;
MoveResizeEwin(ewin, x, y, ewin->client.w, ewin->client.h);
ecore_x_sync();
ESync();
EwinPropagateShapes(ewin);
Mode.queue_up = pq;
@ -902,7 +902,7 @@ EwinShade(EWin * ewin)
#if 0
Eprintf("EwinShade-B\n");
ecore_x_grab();
EGrabServer();
#endif
switch (ewin->border->shadedir)
@ -1066,10 +1066,10 @@ EwinShade(EWin * ewin)
EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
EwinBorderCalcSizes(ewin);
MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
ecore_x_sync();
ESync();
#if 0
ecore_x_ungrab();
EUngrabServer();
Eprintf("EwinShade-E\n");
#endif
@ -1109,7 +1109,7 @@ EwinUnShade(EWin * ewin)
#if 0
Eprintf("EwinUnShade-B\n");
ecore_x_grab();
EGrabServer();
#endif
switch (ewin->border->shadedir)
@ -1301,10 +1301,10 @@ EwinUnShade(EWin * ewin)
MoveResizeEwin(ewin, EoGetX(ewin), EoGetY(ewin), ewin->client.w,
ewin->client.h);
ecore_x_sync();
ESync();
#if 0
ecore_x_ungrab();
EUngrabServer();
Eprintf("EwinUnShade-E\n");
#endif

View File

@ -625,7 +625,7 @@ AddToFamily(EWin * ewin, Window win)
int i, k, num, fx, fy, x, y, desk;
char doslide, manplace;
ecore_x_grab();
EGrabServer();
/* adopt the new baby */
ewin = Adopt(ewin, win);
@ -877,7 +877,7 @@ AddToFamily(EWin * ewin, Window win)
}
done:
ecore_x_ungrab();
EUngrabServer();
}
EWin *
@ -887,7 +887,7 @@ AddInternalToFamily(Window win, const char *bname, int type, void *ptr,
EWin *ewin;
Border *b;
ecore_x_grab();
EGrabServer();
b = NULL;
if (bname)
@ -906,7 +906,7 @@ AddInternalToFamily(Window win, const char *bname, int type, void *ptr,
MoveEwinToDesktopAt(ewin, EoGetDesk(ewin), EoGetX(ewin), EoGetY(ewin));
done:
ecore_x_ungrab();
EUngrabServer();
return ewin;
}
@ -921,7 +921,7 @@ EwinWithdraw(EWin * ewin)
Eprintf("EwinWithdraw %#lx %s state=%d\n", ewin->client.win,
EwinGetName(ewin), ewin->state);
ecore_x_grab();
EGrabServer();
/* Park the client window on the root */
x = ewin->client.x;
@ -933,8 +933,8 @@ EwinWithdraw(EWin * ewin)
ICCCM_Withdraw(ewin);
HintsDelWindowHints(ewin);
ecore_x_sync();
ecore_x_ungrab();
ESync();
EUngrabServer();
if (EwinIsInternal(ewin))
EwinDestroy(ewin);
@ -1216,7 +1216,7 @@ EwinEventCirculateRequest(EWin * ewin, XEvent * ev)
static void
EwinEventPropertyNotify(EWin * ewin, XEvent * ev)
{
ecore_x_grab();
EGrabServer();
EwinChangesStart(ewin);
HintsProcessPropertyChange(ewin, ev->xproperty.atom);
@ -1224,7 +1224,7 @@ EwinEventPropertyNotify(EWin * ewin, XEvent * ev)
SyncBorderToEwin(ewin);
EwinChangesProcess(ewin);
ecore_x_ungrab();
EUngrabServer();
}
static void

View File

@ -24,6 +24,7 @@
* Extended Window Manager Hints.
*/
#include "E.h"
#include "ecore-e16.h"
/*
* _NET_WM_MOVERESIZE client message actions

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
#include <X11/keysym.h>
#include <sys/time.h>
@ -39,10 +40,9 @@ ExtInitWinMain(void)
if (EventDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinMain enter\n");
ecore_x_init(NULL);
disp = ecore_x_display_get();
disp = EDisplayOpen(NULL, -1);
ecore_x_grab();
EGrabServer();
#if 0
imlib_set_cache_size(2048 * 1024);
@ -79,8 +79,8 @@ ExtInitWinMain(void)
XSelectInput(disp, win, StructureNotifyMask);
ecore_x_ungrab();
ecore_x_sync();
EUngrabServer();
ESync();
{
Window w2, ww;
@ -152,14 +152,14 @@ ExtInitWinMain(void)
tv.tv_sec = 0;
tv.tv_usec = 50000;
select(0, NULL, NULL, NULL, &tv);
ecore_x_sync();
ESync();
}
}
if (EventDebug(EDBUG_TYPE_SESSION))
Eprintf("ExtInitWinMain exit\n");
ecore_x_shutdown();
EDisplayClose();
exit(0);
}
@ -175,12 +175,12 @@ ExtInitWinCreate(void)
Eprintf("ExtInitWinCreate\n");
a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False);
ecore_x_sync();
ESync();
if (fork())
{
/* Parent */
ecore_x_ungrab();
EUngrabServer();
for (;;)
{

View File

@ -510,9 +510,9 @@ FocusHandleClick(EWin * ewin, Window win)
Eprintf("FocusHandleClick %#lx %#lx\n", win, ewin->win_container);
if (win == ewin->win_container)
{
ecore_x_sync();
ESync();
XAllowEvents(disp, ReplayPointer, CurrentTime);
ecore_x_sync();
ESync();
}
}
else if (ewin->focusclick)

View File

@ -411,7 +411,7 @@ FX_raindrops_timeout(int val, void *data)
XShmPutImage(disp, fx_raindrops_win, gc1, fx_raindrops_draw->xim, 0, 0,
fx_raindrops[i].x, fx_raindrops[i].y, fx_raindrop_size,
fx_raindrop_size, False);
ecore_x_sync();
ESync();
}
DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ),
FX_raindrops_timeout, 0, NULL);

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
/* WIN_WM_NAME STRING - contains a string identifier for the WM's name */
#define XA_WIN_WM_NAME "_WIN_WM_NAME"

View File

@ -56,7 +56,7 @@ SignalHandler(int sig)
case SIGILL:
if (disp)
ecore_x_ungrab();
EUngrabServer();
DialogAlert(_
("Enlightenment performed an Illegal Instruction.\n" "\n"
"This most likely is due to you having installed an run a\n"
@ -70,7 +70,7 @@ SignalHandler(int sig)
case SIGFPE:
if (disp)
ecore_x_ungrab();
EUngrabServer();
DialogAlert(_
("Enlightenment caused a Floating Point Exception.\n" "\n"
"This means that Enlightenment or support library routines it calls\n"
@ -89,7 +89,7 @@ SignalHandler(int sig)
abort();
loop_count++;
if (disp)
ecore_x_ungrab();
EUngrabServer();
DialogAlert(_
("Enlightenment caused Segment Violation (Segfault)\n" "\n"
"This means that Enlightenment or support library routines it calls\n"
@ -105,7 +105,7 @@ SignalHandler(int sig)
case SIGBUS:
if (disp)
ecore_x_ungrab();
EUngrabServer();
DialogAlert(_
("Enlightenment caused Bus Error.\n" "\n"
"It is suggested you check your hardware and OS installation.\n"

View File

@ -24,6 +24,7 @@
* Feeble attempt to collect hint stuff in one place
*/
#include "E.h"
#include "ecore-e16.h"
/*
* Functions that set X11-properties from E-internals

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
void
ICCCM_Init(void)
@ -769,10 +770,10 @@ ICCCM_GetShapeInfo(EWin * ewin)
int x, y, w, h, d;
Window rt;
ecore_x_grab();
EGrabServer();
EGetGeometry(ewin->client.win, &rt, &x, &y, &w, &h, &d, &d);
rl = EShapeGetRectangles(ewin->client.win, ShapeBounding, &rn, &ord);
ecore_x_ungrab();
EUngrabServer();
if (rn < 1)
{

View File

@ -772,7 +772,8 @@ ImagestateMakePmapMask(ImageState * is, Drawable win, PmapMask * pmm,
if ((flags & ICLASS_ATTR_GLASS) || (bg == None))
bg = VRoot.win;
imlib_context_set_drawable(bg);
ii = imlib_create_image_from_drawable(0, xx, yy, w, h, 1);
ii = imlib_create_image_from_drawable(0, xx, yy, w, h,
!EServerIsGrabbed());
imlib_context_set_image(ii);
imlib_context_set_drawable(win);
}
@ -981,7 +982,7 @@ ImagestateDrawBevel(ImageState * is, Drawable win, GC gc, int w, int h)
XSetForeground(disp, gc, is->lolo.pixel);
XDrawLine(disp, win, gc, w - 2, h - 1, w - 1, h - 1);
XDrawLine(disp, win, gc, w - 1, h - 2, w - 1, h - 1);
ecore_x_sync();
ESync();
break;
case BEVEL_THICKPOINT:
XSetForeground(disp, gc, is->hi.pixel);

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
#include <math.h>
typedef enum
@ -146,7 +147,7 @@ IB_Animate(char iconify, EWin * from, EWin * to)
if (Mode.wm.startup)
return;
ecore_x_grab();
EGrabServer();
spd = 0.00001;
gcv.subwindow_mode = IncludeInferiors;
gcv.function = GXxor;
@ -206,7 +207,7 @@ IB_Animate(char iconify, EWin * from, EWin * to)
XDrawLine(disp, VRoot.win, gc, x3 + 2, y3 + 2, x4 - 2, y4 - 2);
XDrawLine(disp, VRoot.win, gc, x4 + 2, y4 + 2, x1 - 2, y1 - 2);
ecore_x_sync();
ESync();
t2 = GetTime();
t = t2 - t1;
t1 = t2;
@ -276,7 +277,7 @@ IB_Animate(char iconify, EWin * from, EWin * to)
XDrawLine(disp, VRoot.win, gc, x3 + 2, y3 + 2, x4 - 2, y4 - 2);
XDrawLine(disp, VRoot.win, gc, x4 + 2, y4 + 2, x1 - 2, y1 - 2);
ecore_x_sync();
ESync();
t2 = GetTime();
t = t2 - t1;
t1 = t2;
@ -299,7 +300,7 @@ IB_Animate(char iconify, EWin * from, EWin * to)
}
}
EFreeGC(gc);
ecore_x_ungrab();
EUngrabServer();
}
static Iconbox *
@ -785,7 +786,8 @@ IB_SnapEWin(EWin * ewin)
mask = EWindowGetShapePixmap(EoGetWin(ewin));
imlib_context_set_drawable(draw);
im = imlib_create_scaled_image_from_drawable(mask, 0, 0, ww, hh,
w, h, 1, 0);
w, h, !EServerIsGrabbed(),
0);
imlib_context_set_image(im);
imlib_image_set_has_alpha(1); /* Should be set by imlib? */
}
@ -795,7 +797,8 @@ IB_SnapEWin(EWin * ewin)
draw = EoGetWin(ewin);
imlib_context_set_drawable(draw);
im = imlib_create_scaled_image_from_drawable(None, 0, 0, ww, hh,
w, h, 1, 1);
w, h, !EServerIsGrabbed(),
1);
imlib_context_set_image(im);
imlib_image_set_has_alpha(1); /* Should be set by imlib? */
}
@ -824,7 +827,8 @@ IB_GetAppIcon(EWin * ewin)
imlib_context_set_colormap(None);
imlib_context_set_drawable(ewin->client.icon_pmap);
im = imlib_create_image_from_drawable(ewin->client.icon_mask, 0, 0, w, h, 1);
im = imlib_create_image_from_drawable(ewin->client.icon_mask, 0, 0, w, h,
!EServerIsGrabbed());
imlib_context_set_image(im);
imlib_image_set_has_alpha(1); /* Should be set by imlib? */
imlib_context_set_colormap(VRoot.cmap);

View File

@ -267,12 +267,12 @@ main(int argc, char **argv)
#endif
/* sync just to make sure */
ecore_x_sync();
ESync();
Mode.queue_up = DRAW_QUEUE_ENABLE;
/* let's make sure we set this up and go to our desk anyways */
DeskGoto(DesksGetCurrent());
ecore_x_sync();
ESync();
#ifdef SIGCONT
for (i = 0; i < Mode.wm.child_count; i++)
@ -314,7 +314,7 @@ EExit(int exitcode)
if (disp)
{
ecore_x_ungrab();
EUngrabServer();
GrabPointerRelease();
XAllowEvents(disp, AsyncBoth, CurrentTime);

View File

@ -371,7 +371,7 @@ MenuShow(Menu * m, char noshow)
Eprintf("Mode_menus.context_ewin set %s\n",
EwinGetName(Mode_menus.context_ewin));
#endif
ecore_x_sync();
ESync();
#if 1 /* ??? */
Mode_menus.list[0] = m;
Mode_menus.current_depth = 1;

View File

@ -154,7 +154,7 @@ ETimedLoopInit(int k1, int k2, int speed)
etl_fac = (k2 - k1) * speed / 1000.;
gettimeofday(&etl_tv_start, NULL);
ecore_x_sync();
ESync();
}
int
@ -173,7 +173,7 @@ ETimedLoopNext(void)
etl_k = etl_k1 + tm * etl_fac;
y = ETimeCurve(etl_k1, etl_k2, etl_k, 2, 1.0);
ecore_x_sync();
ESync();
CheckEvent();
return y;

View File

@ -67,9 +67,6 @@ ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
SoundPlay("SOUND_MOVE_START");
ModulesSignal(ESIGNAL_MOVE_START, NULL);
if (Conf.movres.mode_move > 0)
ecore_x_grab();
if (grab)
{
GrabPointerRelease();
@ -120,7 +117,7 @@ ActionMoveEnd(EWin * ewin)
if (!ewin)
{
if (Conf.movres.mode_move > 0)
ecore_x_ungrab();
EUngrabServer();
if (Mode.mode == MODE_MOVE)
Conf.movres.mode_move = move_mode_real;
return 0;
@ -158,9 +155,9 @@ ActionMoveEnd(EWin * ewin)
ewin->shape_y - (EoGetY(d2) - EoGetY(d1)));
}
ecore_x_sync();
ESync();
if (Conf.movres.mode_move > 0)
ecore_x_ungrab();
EUngrabServer();
Efree(gwins);
Conf.movres.mode_move = move_mode_real;
@ -190,6 +187,8 @@ ActionMoveSuspend(void)
/* If non opaque undraw our boxes */
if (Conf.movres.mode_move > 0)
{
EUngrabServer();
lst =
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup,
&num);
@ -224,6 +223,9 @@ ActionMoveResume(void)
fl = 0; /* This is the first time we draw it */
}
if (Conf.movres.mode_move > 0)
EGrabServer();
DeskGetCurrentArea(&ax, &ay);
/* Redraw any windows that were in "move mode" */
@ -266,7 +268,7 @@ ActionResizeStart(EWin * ewin, int grab, int hv)
ModulesSignal(ESIGNAL_RESIZE_START, NULL);
if (Conf.movres.mode_resize > 0)
ecore_x_grab();
EGrabServer();
Mode.queue_up = 0;
@ -371,7 +373,7 @@ ActionResizeEnd(EWin * ewin)
if (!ewin)
{
if (Conf.movres.mode_resize > 0)
ecore_x_ungrab();
EUngrabServer();
return 0;
}
Mode.queue_up = DRAW_QUEUE_ENABLE;
@ -381,9 +383,9 @@ ActionResizeEnd(EWin * ewin)
for (i = 0; i < ewin->border->num_winparts; i++)
ewin->bits[i].no_expose = 1;
ecore_x_sync();
ESync();
if (Conf.movres.mode_resize > 0)
ecore_x_ungrab();
EUngrabServer();
ModulesSignal(ESIGNAL_RESIZE_DONE, NULL);
@ -412,6 +414,9 @@ ActionMoveHandleMotion(void)
if (Mode.mode == MODE_MOVE_PENDING)
{
if (Conf.movres.mode_move > 0)
EGrabServer();
for (i = 0; i < num; i++)
{
ewin1 = gwins[i];

View File

@ -137,7 +137,8 @@ ScaleRect(Window src, Pixmap dst, Pixmap * pdst, int sx, int sy, int sw, int sh,
imlib_context_set_drawable(src);
im = imlib_create_scaled_image_from_drawable(None, sx, sy, sw, sh,
scale * dw, scale * dh, 1, 0);
scale * dw, scale * dh,
!EServerIsGrabbed(), 0);
imlib_context_set_image(im);
imlib_context_set_anti_alias(1);
imlib_render_pixmaps_for_whole_image_at_size(&pmap, &mask, dw, dh);

View File

@ -167,7 +167,7 @@ ProgressbarSet(Progressbar * p, int progress)
EobjResize(p->p_win, w, p->h);
XFlush(disp);
EFlush();
}
void
@ -191,7 +191,7 @@ ProgressbarShow(Progressbar * p)
EobjMap(p->win, 0);
EobjMap(p->n_win, 0);
EobjMap(p->p_win, 0);
ecore_x_sync();
ESync();
TextclassApply(p->ic, p->win->win, p->w - (p->h * 5), p->h, 0, 0,
STATE_NORMAL, 0, p->tc, p->win->name);
}

View File

@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "ecore-e16.h"
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
@ -839,7 +840,7 @@ doSMExit(int mode, const char *params)
MapUnmap(1);
XSelectInput(disp, VRoot.win, 0);
ExtInitWinKill();
XSync(disp, False);
ESync();
}
ModulesSignal(ESIGNAL_EXIT, NULL);

View File

@ -46,7 +46,7 @@ MapUnmap(int start)
switch (start)
{
case 0:
ecore_x_grab();
EGrabServer();
XQueryTree(disp, VRoot.win, &rt, &par, &wlist, &num);
for (i = 0; i < num; i++)
{
@ -65,7 +65,7 @@ MapUnmap(int start)
}
/* Flush (get rid of unmap events) */
XSync(disp, True);
ecore_x_ungrab();
EUngrabServer();
break;
case 1:
@ -276,7 +276,7 @@ SetupX(const char *dstr)
mask |= StructureNotifyMask;
XSelectInput(disp, VRoot.win, mask);
ecore_x_sync();
ESync();
Mode.wm.xselect = 0;
/* warn, if necessary about X version problems */

View File

@ -43,7 +43,7 @@ SlideWindowSizeTo(Window win, int fx, int fy, int tx, int ty, int fw, int fh,
{
int k, x, y, w, h;
ecore_x_grab();
EGrabServer();
ETimedLoopInit(0, 1024, speed);
for (k = 0; k <= 1024;)
@ -58,7 +58,7 @@ SlideWindowSizeTo(Window win, int fx, int fy, int tx, int ty, int fw, int fh,
}
EMoveResizeWindow(win, tx, ty, tw, th);
ecore_x_ungrab();
EUngrabServer();
}
static Slideout *
@ -180,7 +180,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Window win)
EChangeWindowAttributes(ButtonGetWindow(s->button[i]),
CWWinGravity, &att);
EMoveResizeWindow(s->win, xx, yy, 1, 1);
ecore_x_sync();
ESync();
EMapRaised(s->win);
SlideWindowSizeTo(s->win, xx + s->w, yy, xx, yy, 0, s->h, s->w, s->h,
Conf.slidespeedmap);
@ -193,7 +193,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Window win)
EChangeWindowAttributes(ButtonGetWindow(s->button[i]),
CWWinGravity, &att);
EMoveResizeWindow(s->win, xx, yy, 1, 1);
ecore_x_sync();
ESync();
EMapRaised(s->win);
SlideWindowSizeTo(s->win, xx, yy, xx, yy, 0, s->h, s->w, s->h,
Conf.slidespeedmap);
@ -206,7 +206,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Window win)
EChangeWindowAttributes(ButtonGetWindow(s->button[i]),
CWWinGravity, &att);
EMoveResizeWindow(s->win, xx, yy, 1, 1);
ecore_x_sync();
ESync();
EMapRaised(s->win);
SlideWindowSizeTo(s->win, xx, yy + s->h, xx, yy, s->w, 0, s->w, s->h,
Conf.slidespeedmap);
@ -219,7 +219,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Window win)
EChangeWindowAttributes(ButtonGetWindow(s->button[i]),
CWWinGravity, &att);
EMoveResizeWindow(s->win, xx, yy, 1, 1);
ecore_x_sync();
ESync();
EMapRaised(s->win);
SlideWindowSizeTo(s->win, xx, yy, xx, yy, s->w, 0, s->w, s->h,
Conf.slidespeedmap);

View File

@ -798,7 +798,6 @@ TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h,
switch (ts->style.orientation)
{
case FONT_TO_UP:
ecore_x_sync(); /* Workaround for crash seen with Absolute E (Imlib2?) */
imlib_context_set_drawable(win);
ii = imlib_create_image_from_drawable(0, y, x, h, w, 0);
imlib_context_set_image(ii);
@ -809,7 +808,6 @@ TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h,
case FONT_TO_DOWN:
XGetGeometry(disp, win, &rr, &win_x, &win_y, &win_w, &win_h,
&win_b, &win_d);
ecore_x_sync(); /* Workaround for crash seen with Absolute E (Imlib2?) */
imlib_context_set_drawable(win);
ii = imlib_create_image_from_drawable(0, win_w - y - h, x, h, w, 0);
imlib_context_set_image(ii);
@ -818,7 +816,6 @@ TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h,
imlib_render_image_on_drawable_at_size(0, 0, w, h);
break;
case FONT_TO_LEFT: /* Holy carumba! That's for yoga addicts, maybe .... */
ecore_x_sync(); /* Workaround for crash seen with Absolute E (Imlib2?) */
imlib_context_set_drawable(win);
ii = imlib_create_image_from_drawable(0, x, y, w, h, 0);
imlib_context_set_image(ii);

View File

@ -559,7 +559,7 @@ TooltipShow(ToolTip * tt, const char *text, ActionClass * ac, int x, int y)
if (tt->win[i])
EobjMap(tt->win[i], 0);
ecore_x_sync();
ESync();
xx = ic->padding.left + iw;
@ -666,7 +666,7 @@ TooltipHide(ToolTip * tt)
if (tt->win[i])
EobjUnmap(tt->win[i]);
ecore_x_sync();
ESync();
}
/*

View File

@ -142,7 +142,7 @@ main(int argc, char **argv)
win = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 0, 0, 640, 480, 0,
0, 0);
XMapWindow(disp, win);
ecore_x_sync();
ESync();
gcv.subwindow_mode = IncludeInferiors;
gc = ECreateGC(disp, win, GCSubwindowMode, &gcv);
@ -166,13 +166,13 @@ main(int argc, char **argv)
#ifndef USE_ECORE_X
void
ecore_x_grab(void)
EGrabServer(void)
{
XGrabServer(disp);
}
void
ecore_x_ungrab(void)
EUngrabServer(void)
{
XUngrabServer(disp);
XFlush(disp);

View File

@ -208,7 +208,7 @@ WarpFocusShow(EWin * ewin)
PropagateShapes(warpFocusWindow->win);
Mode.queue_up = pq;
XFlush(disp);
EFlush();
}
static void

48
src/x.c
View File

@ -366,11 +366,11 @@ EMoveWindow(Window win, int x, int y)
{
xid->x = x;
xid->y = y;
ecore_x_window_move(win, x, y);
XMoveWindow(disp, win, x, y);
}
}
else
ecore_x_window_move(win, x, y);
XMoveWindow(disp, win, x, y);
}
void
@ -385,11 +385,11 @@ EResizeWindow(Window win, int w, int h)
{
xid->w = w;
xid->h = h;
ecore_x_window_resize(win, w, h);
XResizeWindow(disp, win, w, h);
}
}
else
ecore_x_window_resize(win, w, h);
XResizeWindow(disp, win, w, h);
}
void
@ -410,11 +410,11 @@ EMoveResizeWindow(Window win, int x, int y, int w, int h)
xid->y = y;
xid->w = w;
xid->h = h;
ecore_x_window_move_resize(win, x, y, w, h);
XMoveResizeWindow(disp, win, x, y, w, h);
}
}
else
ecore_x_window_move_resize(win, x, y, w, h);
XMoveResizeWindow(disp, win, x, y, w, h);
}
void
@ -740,7 +740,7 @@ EReparentWindow(Window win, Window parent, int x, int y)
{
xid->x = x;
xid->y = y;
ecore_x_window_move(win, x, y);
XMoveWindow(disp, win, x, y);
}
}
else
@ -995,9 +995,8 @@ EWindowGetShapePixmap(Window win)
return mask;
}
#ifndef USE_ECORE_X
void
ecore_x_grab(void)
EGrabServer(void)
{
if (Mode.server_grabbed <= 0)
XGrabServer(disp);
@ -1005,7 +1004,7 @@ ecore_x_grab(void)
}
void
ecore_x_ungrab(void)
EUngrabServer(void)
{
if (Mode.server_grabbed == 1)
{
@ -1016,7 +1015,24 @@ ecore_x_ungrab(void)
if (Mode.server_grabbed < 0)
Mode.server_grabbed = 0;
}
#endif
int
EServerIsGrabbed(void)
{
return Mode.server_grabbed;
}
void
EFlush(void)
{
XFlush(disp);
}
void
ESync(void)
{
XSync(disp, False);
}
Window
GetWinParent(Window win)
@ -1119,10 +1135,10 @@ WindowAtXY(int x, int y)
unsigned int num;
int i;
ecore_x_grab();
EGrabServer();
if (!XQueryTree(disp, VRoot.win, &root_win, &parent_win, &list, &num))
{
ecore_x_ungrab();
EUngrabServer();
return VRoot.win;
}
if (list)
@ -1140,13 +1156,13 @@ WindowAtXY(int x, int y)
continue;
XFree(list);
ecore_x_ungrab();
EUngrabServer();
return child;
}
while (--i > 0);
XFree(list);
}
ecore_x_ungrab();
EUngrabServer();
return VRoot.win;
}
@ -1239,7 +1255,7 @@ EDrawableDumpImage(Drawable draw, const char *txt)
if (w <= 0 || h <= 0)
return;
imlib_context_set_drawable(draw);
im = imlib_create_image_from_drawable(None, 0, 0, w, h, 1);
im = imlib_create_image_from_drawable(None, 0, 0, w, h, !EServerIsGrabbed());
imlib_context_set_image(im);
imlib_image_set_format("png");
sprintf(buf, "%s-%#lx-%d", txt, draw, seqn++);

View File

@ -218,7 +218,7 @@ Zoom(EWin * ewin)
SwitchRes(0, 0, 0, 0, 0);
XWarpPointer(disp, None, ewin->client.win, 0, 0, 0, 0,
ewin->client.w / 2, ewin->client.h / 2);
ecore_x_sync();
ESync();
zoom_last_ewin = NULL;
}
return;
@ -262,7 +262,7 @@ Zoom(EWin * ewin)
zoom_mask_2 = ZoomMask(0, 0, mode->hdisplay, y1);
zoom_mask_3 = ZoomMask(x1 + ewin->client.w, 0, x2, mode->vdisplay);
zoom_mask_4 = ZoomMask(0, y1 + ewin->client.h, mode->hdisplay, y2);
ecore_x_sync();
ESync();
}
}