Beispiel #1
0
void
subScreenKill(SubScreen *s)
{
  assert(s);

  if(s->panels) subArrayKill(s->panels, True);

  /* Destroy panel windows */
  if(s->panel1)
    {
      XDeleteContext(subtle->dpy, s->panel1, SCREENID);
      XDestroyWindow(subtle->dpy, s->panel1);
    }
  if(s->panel2)
    {
      XDeleteContext(subtle->dpy, s->panel2, SCREENID);
      XDestroyWindow(subtle->dpy, s->panel2);
    }

  /* Destroy drawable */
  if(s->drawable) XFreePixmap(subtle->dpy, s->drawable);

  free(s);

  subSharedLogDebugSubtle("kill=screen\n");
} /* }}} */
Beispiel #2
0
void wcore_unmap(WCoreWindow *core)
{
	if (core) {
		XDeleteContext(dpy, core->window, w_global.context.client_win);
		XDestroyWindow(dpy, core->window);
	}
}
Beispiel #3
0
Datei: DragBS.c Projekt: att/uwin
/*
 * cache the atoms table
 */
static void
set_atoms_table(Display *display, XmDndAtomsTable table)
{
    XmDndAtomsTable atoms;

    DEBUGOUT(_LtDebug0(__FILE__, NULL, "%s:set_atoms_table(%d)\n",
		      __FILE__, __LINE__));

    if (displayToAtoms == (XContext)0)
	displayToAtoms = XUniqueContext();

    if (XFindContext(display, DefaultRootWindow(display),
		     displayToAtoms, (XPointer *)&atoms) == XCSUCCESS)
    {
	if (atoms == table)
	{
	    return;
	}

	XDeleteContext(display, DefaultRootWindow(display),
		       displayToAtoms);
    }

    XSaveContext(display, DefaultRootWindow(display),
		 displayToAtoms, (XPointer)table);
}
Beispiel #4
0
Datei: x.c Projekt: Limsik/e17
static void
EXidDel(Win win)
{
#if DEBUG_XWIN
   Eprintf("EXidDel: %p %#lx\n", win, win->xwin);
#endif
   if (win == win_first)
     {
	if (win == win_last)
	  {
	     win_first = win_last = NULL;
	  }
	else
	  {
	     win_first = win->next;
	     win->next->prev = NULL;
	  }
     }
   else if (win == win_last)
     {
	win_last = win->prev;
	win->prev->next = NULL;
     }
   else
     {
	win->prev->next = win->next;
	win->next->prev = win->prev;
     }

   XDeleteContext(disp, win->xwin, xid_context);
   if (win->in_use)
      win->do_del = 1;
   else
      EXidDestroy(win);
}
Beispiel #5
0
static DWORD
DrvDestroyWindows(LPARAM dwParm1, LPARAM dwParm2, LPVOID lpStruct)
{
    Window win = (Window)lpStruct;
    PRIVATEDISPLAY *Disp = GETDP();

    XDeleteContext(Disp->display,win,Disp->client_hwnd);
    XDeleteContext(Disp->display,win,Disp->window_style);
    XDeleteContext(Disp->display,win,Disp->window_ex_style);

    XDestroyWindow(Disp->display, win);

    DriverFlushXEvents();

    return 1L;
}
Beispiel #6
0
/* ARGSUSED */
static void 
Destroy(
        Widget w )
{
    XmPrintShellWidget print_shell = (XmPrintShellWidget) w ;

    /* need to remove the pixmap from this shell: no sharing
       between diff shell and the same shell pointer id can
       come up next time */
    _XmCleanPixmapCache (XtScreen(w), w);

    if (!print_shell->print.xp_connected)
	return ;

    /*** remove entry in the widget/XPContext table, used in 
         the event dispatch mechanism */
    DeleteFromTable(XpGetContext(XtDisplay(w)), w);

    _XmProcessLock();
    /* unmark the screen of this print shell in this context */
    XDeleteContext(XtDisplay(w), (XID)XtScreen(w), 
		   _XmPrintScreenToShellContext);
    /* also maintain a counter of all shells alive */
    _XmPrintShellCounter -- ;
    _XmProcessUnlock();
}
Beispiel #7
0
void X11Window::_impl_destroy()
{
    XDeleteContext(m_Display, m_Window, sX11Context);
    XUnmapWindow(m_Display, m_Window);
    XDestroyWindow(m_Display, m_Window);
    m_Window = 0;
}
Beispiel #8
0
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->monitor)
        leaveFullscreenMode(window);

    _glfwDestroyContext(window);

    if (window->x11.handle)
    {
        if (window->x11.handle ==
            XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD))
        {
            _glfwPushSelectionToManager(window);
        }

        XDeleteContext(_glfw.x11.display, window->x11.handle, _glfw.x11.context);
        XUnmapWindow(_glfw.x11.display, window->x11.handle);
        XDestroyWindow(_glfw.x11.display, window->x11.handle);
        window->x11.handle = (Window) 0;
    }

    if (window->x11.colormap)
    {
        XFreeColormap(_glfw.x11.display, window->x11.colormap);
        window->x11.colormap = (Colormap) 0;
    }
}
Beispiel #9
0
Datei: DragBS.c Projekt: att/uwin
/*
 * cache the atoms table
 */
static void
set_targets_table(Display *display, XmDndTargetsTable table)
{
    XmDndTargetsTable targets;

    DEBUGOUT(_LtDebug0(__FILE__, NULL, "%s:set_targets_table(%d) - %p\n",
		      __FILE__, __LINE__, table));

    if (displayToTargets == (XContext)0)
    {
	displayToTargets = XUniqueContext();
    }

    if (XFindContext(display, DefaultRootWindow(display),
		     displayToTargets, (XPointer *)&targets) == XCSUCCESS)
    {

	if (targets == table)
	{
	    return;
	}

	XDeleteContext(display, DefaultRootWindow(display),
		       displayToTargets);
    }

    XSaveContext(display, DefaultRootWindow(display),
		 displayToTargets, (XPointer)table);
}
Beispiel #10
0
/* ARGSUSED */
static void 
DisplayDestroy(
        Widget w )
{
    XmDisplay dd = (XmDisplay) w ;
    XContext context;

    _XmProcessLock();
    context = displayContext;
    _XmProcessUnlock();


    XtFree((char *) dd->display.modals);

    if (((XmDisplayInfo *)(dd->display.displayInfo))
		->excParentPane.pane != (Widget *)NULL)
	XtFree((char *) ((XmDisplayInfo *)(dd->display.displayInfo))
		->excParentPane.pane);
    XtFree((char *) dd->display.displayInfo);

    /* Destroy the DropSiteManager object. */
    if (dd->display.dsm != NULL)
	XtDestroyWidget((Widget) dd->display.dsm);

    _XmVirtKeysDestroy (w);

    XDeleteContext( XtDisplay( w), None, context) ;
}
Beispiel #11
0
Window::~Window() noexcept
{
	auto display = application_->display_;
	XDeleteContext(display, id_, application_->context_);
	glXDestroyContext(display, context_);
	XDestroyWindow(display, id_);
	XFreeColormap(display, colormap_);
}
static void
set_window_surface (x_global_t *xg, Window wid, cairo_5c_surface_t *c5s)
{
    if (c5s == NULL)
	XDeleteContext (xg->dpy, wid, xg->context);
    else
	XSaveContext (xg->dpy, wid, xg->context, (XPointer) c5s);
}
Beispiel #13
0
void    UxDeleteContextCB( Widget wgt, XtPointer client_data,
                                                XtPointer _call_data )
#endif
{
        (void) XDeleteContext( XtDisplay( UxTopLevel ),
                               (Window) wgt,
                               (XContext) client_data );
}
Beispiel #14
0
void wCoreDestroy(WCoreWindow * core)
{
	if (core->stacking)
		wfree(core->stacking);

	XDeleteContext(dpy, core->window, wWinContext);
	XDestroyWindow(dpy, core->window);
	wfree(core);
}
Beispiel #15
0
/******************************************************************************
NAME:           UxDeleteContextCB( wgt, client_data, call_data )

INPUT:          Widget          wgt             - widget causing the callback
                XtPointer       client_data     - not used
                XtPointer       call_data       - not used

RETURN:         void

DESCRIPTION:    Deletes the X context entry.

EXT REFERENCES: UxTopLevel, xcontext_id

CREATION:       Visual Edge Software            April 6 1991
-----------------------------------------------------------------------------*/
void    UxDeleteContextCB( Widget wgt, XtPointer client_data,
                                                XtPointer _call_data )
{
        XtPointer       call_data = _call_data;

        (void) XDeleteContext( XtDisplay( UxTopLevel ),
                               (Window) wgt,
                               (XContext)(XtArgVal) client_data );
}
Beispiel #16
0
void flushclients()
{
  unsigned int i, nwins;
  Window dw1, dw2, *wins;
  Client *c;
#ifdef ASSIMILATE_WINDOWS
  Scrn *scr2;
#endif

  if((scr = front)) do {
    scr = scr->upfront;
    XQueryTree(dpy, scr->back, &dw1, &dw2, &wins, &nwins);
    for(i=0; i<nwins; i++)
      if((!XFindContext(dpy, wins[i], client_context, (XPointer *)&c))&&wins[i]==c->parent) {
	int x,y;
	grav_map_frame_to_win(c, c->x, c->y, &x, &y);
	XReparentWindow(dpy, c->window, scr->root, x, y);
	XSetWindowBorderWidth(dpy, c->window, c->old_bw);
	XRemoveFromSaveSet(dpy, c->window);
	wins[i]=c->window;
	rmclient(c);
      }
#ifdef ASSIMILATE_WINDOWS
      else if((!XFindContext(dpy, wins[i], screen_context, (XPointer *)&scr2)) && scr2==scr) {
	XWindowAttributes attr;
	XSetWindowAttributes xsa;
	XGetWindowAttributes(dpy, wins[i], &attr);
	XReparentWindow(dpy, wins[i], scr->root, attr.x, attr.y);
	xsa.override_redirect = True;
	XChangeWindowAttributes(dpy, wins[i], CWOverrideRedirect, &xsa);
	XDeleteContext(dpy, wins[i], screen_context);
	XRemoveFromSaveSet(dpy, wins[i]);
      }
#endif
    /*
      if(nwins) {
      for(i=0; i<(nwins>>1); i++) {
      Window w=wins[i];
      wins[i]=wins[nwins-1-i];
      wins[nwins-1-i]=w;
      }
      XRestackWindows(dpy, wins, nwins);
      }
      */
    XFree((void *) wins);
  } while(scr!=front);
  while((c=clients)) {
    if(c->parent != c->scr->root) {
      int x,y;
      grav_map_frame_to_win(c, c->x, c->y, &x, &y);
      XReparentWindow(dpy, c->window, c->scr->root, x, y);
      XSetWindowBorderWidth(dpy, c->window, c->old_bw);
      XRemoveFromSaveSet(dpy, c->window);
    }
    rmclient(c);
  }
}
Beispiel #17
0
void x_object_destroy(XObject * obj)
{
	Window root,parent,*childlist;
	XObject* child;
	unsigned childcnt,i;
	if(XQueryTree(dis,obj->obj.win,&root,&parent,&childlist,&childcnt)!=0)
	{
		if(childlist!=NULL)
		{
			for(i=0;i<childcnt;i++)
			{
				child=NULL;
				XFindContext(dis,childlist[i],xctxt,(XPointer*)&child);
				if(child!=NULL)
					x_object_destroy(child);
			}
			XFree(childlist);
		}
	}
	if(obj->obj.type==XWINDOW)
		obj->window.focus=NULL;
	else if(obj->obj.parentwindow->window.focus)
		x_object_set_focused(obj->obj.parentwindow);
	XDeleteContext(dis,obj->obj.win,xctxt);
	XDestroyWindow(dis,obj->obj.win);
	switch(obj->obj.type)
	{
	case XWINDOW:
		XFree(obj->window.header.value);
		if(modalwindow==obj)
			modalwindow=NULL;
		break;
	case XBUTTON:
		x_gc_unref(obj->button.Black);
		x_gc_unref(obj->button.Gray);
		x_gc_unref(obj->button.White);
		free(obj->button.text);
		break;
	case XFRAME:
		break;
	case XLABEL:
		free(obj->label.text);
		break;
	case XTEXTBOX:
		free(obj->textbox.buffer);
		x_gc_unref(obj->textbox.SelectFocused);
		x_gc_unref(obj->textbox.SelectUnfocused);
		break;
	case XSCROLL:
		x_gc_unref(obj->scroll.Black);
		x_gc_unref(obj->scroll.Gray);
		x_gc_unref(obj->scroll.White);
		break;
	}
	free(obj);
}
Beispiel #18
0
Datei: dock.c Projekt: Cougar/pwm
void destroy_dock(WDock *dock)
{
	unlink_winobj_d((WWinObj*)dock);

	SCREEN->dock=NULL;

	XDeleteContext(wglobal.dpy, dock->win, wglobal.win_context);
	XDestroyWindow(wglobal.dpy, dock->win);
	
	free_thing((WThing*)dock);
}
Beispiel #19
0
void rmclient(Client *c)
{
    Client *cc;

    if (c == clients)
      clients = c->next;
    else
      if((cc = clients))
	for (; cc->next; cc = cc->next)
	  if (cc->next == c) {
            cc->next = cc->next->next;
	    break;
	  }

    if(c->active) {
      if(!menuactive)
	setfocus(None);
      c->active=False;
      activeclient = NULL;
      XInstallColormap(dpy, scr->cmap);
    } else if(prefs.focus==FOC_CLICKTOTYPE)
      XUngrabButton(dpy, Button1, AnyModifier, c->parent);
#ifdef USE_FONTSETS
    if(c->title)
      free(c->title);
#else
    if(c->title.value)
      XFree(c->title.value);
#endif
    if(c->parent != c->scr->root) {
      XDestroyWindow(dpy, c->parent);
      XDeleteContext(dpy, c->parent, client_context);
    }
    if(c->close)
      XDeleteContext(dpy, c->close, client_context);
    if(c->drag)
      XDeleteContext(dpy, c->drag, client_context);
    if(c->iconify)
      XDeleteContext(dpy, c->iconify, client_context);
    if(c->zoom)
      XDeleteContext(dpy, c->zoom, client_context);
    if(c->depth)
      XDeleteContext(dpy, c->depth, client_context);
    if(c->resize)
      XDeleteContext(dpy, c->resize, client_context);
    if(c->icon)
      rmicon(c->icon);
    if(c->window)
      XDeleteContext(dpy, c->window, client_context);
    free(c);
}
Beispiel #20
0
static void close_x_dialog_win (Display *dpy, Window *win) {
	struct XJDialog *dlg = NULL;
	if (!win || !*win) return;
	XFindContext (dpy, *win, _dlg_ctx, (XPointer*)&dlg);
	if (dlg) {
		XDeleteContext (dpy, *win, _dlg_ctx);
		XFreeGC (dpy, dlg->gc);
		free(dlg);
	}
	XDestroyWindow (dpy, *win);
	*win = 0;
}
Beispiel #21
0
void wApplicationDestroy(WApplication * wapp)
{
	WWindow *wwin;
	WScreen *scr;

	if (!wapp)
		return;

	wapp->refcount--;
	if (wapp->refcount > 0)
		return;

	if (wapp->urgent_bounce_timer) {
		WMDeleteTimerHandler(wapp->urgent_bounce_timer);
		wapp->urgent_bounce_timer = NULL;
	}
	if (wapp->flags.bouncing) {
		/* event.c:handleDestroyNotify forced this destroy
		   and thereby overlooked the bounce callback */
		wapp->refcount = 1;
		return;
	}

	scr = wapp->main_window_desc->screen_ptr;

	if (wapp == scr->wapp_list) {
		if (wapp->next)
			wapp->next->prev = NULL;
		scr->wapp_list = wapp->next;
	} else {
		if (wapp->next)
			wapp->next->prev = wapp->prev;
		if (wapp->prev)
			wapp->prev->next = wapp->next;
	}

	XDeleteContext(dpy, wapp->main_window, wAppWinContext);
	wAppMenuDestroy(wapp->menu);

	/* Remove application icon */
	removeAppIconFor(wapp);

	wwin = wWindowFor(wapp->main_window_desc->client_win);

	wWindowDestroy(wapp->main_window_desc);
	if (wwin) {
		/* undelete client window context that was deleted in
		 * wWindowDestroy */
		XSaveContext(dpy, wwin->client_win, wWinContext, (XPointer) & wwin->client_descriptor);
	}
	wfree(wapp);
}
Beispiel #22
0
void DestroyMenu(Menu *menu)
{
  Node *mi;

  mi=NULL;
  while((mi=NodeNext(menu->Items,mi))) {
    MenuItem *item;
    item=mi->data;
    if(item->type!=I_LINE) {
      XDeleteContext(disp,item->win,TheScreen.MenuContext);
      XDestroyWindow(disp,item->win);
    }
    if(item->type==I_SUBMENU) DestroyMenu(item->data); /***/
    if(item->name!=linename) free(item->name);
    free(item);
  }
  XDeleteContext(disp, menu->win, TheScreen.MenuFrameContext);
  XDestroyWindow(disp,menu->win);
  NodeListDelete(&(menu->Items));
  if(menu->name) free(menu->name);
  free(menu);
}
Beispiel #23
0
Datei: menu.c Projekt: Cougar/pwm
static void do_destroy_menu(WMenu *menu)
{
	if(--menu->data->nref==0 && menu->data->deinit_func!=NULL)
		menu->data->deinit_func(menu->data);
	
	if(menu->data->inst1==menu)
		menu->data->inst1=NULL;
	
	unlink_winobj_d((WWinObj*)menu);
	XDeleteContext(wglobal.dpy, menu->menu_win, wglobal.win_context);
	XDestroyWindow(wglobal.dpy, menu->menu_win);
	free_thing((WThing*)menu);
}
Beispiel #24
0
Bool unmap(wm_t *wm, wm_event_t *event) {
  client_t *client = event->client;
  container_t *container = NULL;
  wm_log(wm, LOG_INFO, "%s; unmap on %d", __func__, client->window);
  XFindContext(wm->dpy, client->window, client_container_context, (XPointer *)&container);
  XDeleteContext(wm->dpy, client->window, client_container_context);
  if (container != NULL) {
    wm_log(wm, LOG_INFO, "%s; unmap window", __func__);
  }

  //XGrabServer(wm->dpy);
  //XReparentWindow(wm->dpy, client->window, client->screen->root, 0, 0);
  //XUngrabServer(wm->dpy);
  return True;
}
void
xawt_removeWindow (JNIEnv *env, Window window)
{
  jobject obj;
  
  /* Lock to make sure we aren't processing an event for this window while it gets destroyed. */
    
  pthread_mutex_lock(&eventMutex);

  if(XFindContext(xawt_display, window, xawt_context, (XPointer *)&obj)==0) {

    (*env)->DeleteGlobalRef (env, obj);
    XDeleteContext(xawt_display, window, xawt_context);
    XDestroyWindow(xawt_display, window);
  }
  
  pthread_mutex_unlock(&eventMutex);
}
Beispiel #26
0
static void
DestroyAllIM(XawVendorShellExtPart *ve)
{
    XawIcTableList	p;
    contextErrDataRec *contextErrData;

    /*
     * Destory all ICs
     */
    if (IsSharedIC(ve)) {
        if ((p = ve->ic.shared_ic_table) && p->xic) {
            DestroyIC(p->widget, ve);
            p->xic = NULL;
            p->ic_focused = FALSE;
        }
    } else {
	for (p = ve->ic.ic_table; p; p = p->next) {
	    if (p->xic == NULL) continue;
	    DestroyIC(p->widget, ve);
	    p->xic = NULL;
	    p->ic_focused = FALSE;
	}
    }
    if (!ve->im.xim) return;
    /*
     * Close Input Method
     */
    if (!XFindContext(XDisplayOfIM(ve->im.xim), (Window)(uintptr_t)ve->im.xim, errContext,
		      (XPointer*)&contextErrData)) {
	if (contextErrData) XtFree((char *)contextErrData);
    }
    XDeleteContext(XDisplayOfIM(ve->im.xim), (Window)(uintptr_t)ve->im.xim, errContext);
    CloseIM(ve);
    ve->im.xim = NULL;

    /*
     * resize vendor shell to core size
     */
    (void) SetVendorShellHeight(ve, 0);
    /*
    XawVendorShellExtResize(vw);
    */
    return;
}
Beispiel #27
0
static void
FreeAllDataOfVendorShell(XawVendorShellExtPart *ve, VendorShellWidget vw)
{
    XawIcTableList       p, next;
    contextErrDataRec *contextErrData;

    if (!XFindContext(XtDisplay(vw), (Window)(uintptr_t)vw, extContext,
		      (XPointer*)&contextErrData)) {
	if (contextErrData) XtFree((char *)contextErrData);
    }
    XDeleteContext(XtDisplay(vw), (Window)(uintptr_t)vw, extContext);
    if (ve->ic.shared_ic_table)
        XtFree((char *)ve->ic.shared_ic_table);
    if (ve->im.resources) XtFree((char *)ve->im.resources);
    for (p = ve->ic.ic_table; p; p = next) {
        next = p->next;
        XtFree((char *)p);
    }
}
Beispiel #28
0
void
subTrayKill(SubTray *t)
{
  assert(t);

  /* Ignore further events and delete context */
  XSelectInput(subtle->dpy, t->win, NoEventMask);
  XDeleteContext(subtle->dpy, t->win, TRAYID);

  /* Unembed tray icon following xembed specs */
  XUnmapWindow(subtle->dpy, t->win);
  XReparentWindow(subtle->dpy, t->win, ROOT, 0, 0);
  XMapRaised(subtle->dpy, t->win);

  if(t->name) free(t->name);
  free(t);

  subSharedLogDebugSubtle("kill=tray\n");
} /* }}} */
Beispiel #29
0
void glwtWindowDestroy(GLWTWindow *win)
{
    if(!win)
        return;

    if(XDeleteContext(glwt.x11.display, win->x11.window, glwt.x11.xcontext) != 0)
        glwtErrorPrintf("XDeleteContext failed");

#ifdef GLWT_USE_EGL
    glwtWindowDestroyEGL(win);
#else
    glwtWindowDestroyGLX(win);
#endif

    if(win->x11.window)
        XDestroyWindow(glwt.x11.display, win->x11.window);

    free(win);
}
Beispiel #30
0
void window_deinit(WWindow *wwin)
{
    region_deinit((WRegion*)wwin);
    
    region_pointer_focus_hack(&wwin->region);
    
    if(wwin->xic!=NULL)
        XDestroyIC(wwin->xic);
        
    if(wwin->win!=None){
        XDeleteContext(ioncore_g.dpy, wwin->win, ioncore_g.win_context);
        /* Probably should not try destroy if root window... */
        XDestroyWindow(ioncore_g.dpy, wwin->win);
    }
    
    /* There are no backlinks from WStacking to us, so it is not
     * necessary to do any deinitialisation there.
     */
}