Beispiel #1
0
static void
IB_Animate(Container * ct, int iconify, EWin * ewin)
{
   if (Mode.wm.startup || ct->anim_mode <= 0)
      return;

   if (Conf_containers.anim_time < 10 || Conf_containers.anim_time > 10000)
      Conf_containers.anim_time = 250;

   EobjsRepaint();
   EGrabServer();

   switch (ct->anim_mode)
     {
     default:
	break;
     case 1:
	IB_Animate_A(iconify, ewin, ct->ewin);
	break;
     case 2:
	IB_Animate_B(iconify, ewin, ct->ewin);
	break;
     }

   EUngrabServer();
}
Beispiel #2
0
static int
SystrayGetXembedInfo(EX_Window xwin, unsigned int *info)
{
   int                 num;

   EGrabServer();

   if (!EXWindowOk(xwin))
     {
	/* Invalid window */
	num = -1;
	goto done;
     }

   num = ex_window_prop_xid_get(xwin, E_XA__XEMBED_INFO,
				E_XA__XEMBED_INFO, info, 2);

   if (num < 2)
     {
	/* Property invalid or not there. */
	info[0] = 0;		/* Set protocol version 0 */
	info[1] = XEMBED_MAPPED;	/* Set mapped */
	num = 0;
     }

 done:
   EUngrabServer();

   return num;
}
Beispiel #3
0
Datei: x.c Projekt: Limsik/e17
int
EDrawableCheck(Drawable draw, int grab)
{
   int                 ok;

   if (draw == None)
      return 0;

   if (grab)
      EGrabServer();

   ok = EXGetGeometry(draw, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

   if (grab && !ok)
      EUngrabServer();

   return ok;
}
Beispiel #4
0
static              Window
ExtInitWinMain(void)
{
   int                 i, loop, err;
   Ecore_X_Window      win;
   XGCValues           gcv;
   GC                  gc;
   Pixmap              pmap;
   Atom                a;
   EiwData             eiwd;
   EiwLoopFunc        *eiwc_loop_func;

   if (EDebug(EDBUG_TYPE_SESSION))
      Eprintf("ExtInitWinMain enter\n");

   err = EDisplayOpen(NULL, -1);
   if (err)
      return None;

   EGrabServer();

   EImageInit();

   eiwd.attr.backing_store = NotUseful;
   eiwd.attr.override_redirect = True;
   eiwd.attr.colormap = WinGetCmap(VROOT);
   eiwd.attr.border_pixel = 0;
   eiwd.attr.background_pixel = 0;
   eiwd.attr.save_under = True;
   win = XCreateWindow(disp, WinGetXwin(VROOT),
		       0, 0, WinGetW(VROOT), WinGetH(VROOT),
		       0, CopyFromParent, InputOutput, CopyFromParent,
		       CWOverrideRedirect | CWSaveUnder | CWBackingStore |
		       CWColormap | CWBackPixel | CWBorderPixel, &eiwd.attr);

   pmap = XCreatePixmap(disp, win,
			WinGetW(VROOT), WinGetH(VROOT), WinGetDepth(VROOT));
   gcv.subwindow_mode = IncludeInferiors;
   gc = XCreateGC(disp, win, GCSubwindowMode, &gcv);
   XCopyArea(disp, WinGetXwin(VROOT), pmap, gc,
	     0, 0, WinGetW(VROOT), WinGetH(VROOT), 0, 0);
   XSetWindowBackgroundPixmap(disp, win, pmap);
   XMapRaised(disp, win);
   XFreePixmap(disp, pmap);
   XFreeGC(disp, gc);

   a = EInternAtom("ENLIGHTENMENT_RESTART_SCREEN");
   ecore_x_window_prop_window_set(WinGetXwin(VROOT), a, &win, 1);

   XSelectInput(disp, win, StructureNotifyMask);

   EUngrabServer();
   ESync(0);

#if USE_EIWC_WINDOW && USE_EIWC_RENDER
   eiwc_loop_func = _eiw_render_init(win, &eiwd);
   if (!eiwc_loop_func)
      eiwc_loop_func = _eiw_window_init(win, &eiwd);
#elif USE_EIWC_RENDER
   eiwc_loop_func = _eiw_render_init(win, &eiwd);
#elif USE_EIWC_WINDOW
   eiwc_loop_func = _eiw_window_init(win, &eiwd);
#endif
   if (!eiwc_loop_func)
      return None;

   {
      XWindowAttributes   xwa;
      char                s[1024];
      EImage             *im;

      for (i = loop = 1;; i++, loop++)
	{
	   if (i > 12)
	      i = 1;

	   /* If we get unmapped we are done */
	   XGetWindowAttributes(disp, win, &xwa);
	   if (xwa.map_state == IsUnmapped)
	      break;

	   Esnprintf(s, sizeof(s), "pix/wait%i.png", i);
	   if (EDebug(EDBUG_TYPE_SESSION) > 1)
	      Eprintf("ExtInitWinCreate - child %s\n", s);

	   im = ThemeImageLoad(s);
	   if (im)
	     {
		eiwc_loop_func(win, im, &eiwd);
		EImageFree(im);
	     }
	   ESync(0);
	   usleep(50000);

	   /* If we still are here after 5 sec something is wrong. */
	   if (loop > 100)
	      break;
	}
   }

   if (EDebug(EDBUG_TYPE_SESSION))
      Eprintf("ExtInitWinMain exit\n");

   EDisplayClose();

   exit(0);
}