XCTRL_API void set_window_title(Display *disp, Window win, const char *title, char mode) { char *title_utf8; char *title_local; Atom utf8_atom = GetUTF8Atom(); if (envir_utf8) { title_utf8 = strdup(title); title_local = NULL; } else { title_utf8 = locale_to_utf8(title); if (!title_utf8) { title_utf8 = strdup(title); } title_local = strdup(title); } if (mode == 'T' || mode == 'N') { if (title_local) { replace_prop(disp, win, XA_WM_NAME, XA_STRING,title_local); } else { XDeleteProperty(disp, win, XA_WM_NAME); } replace_prop(disp, win, XInternAtom(disp,"_NET_WM_NAME",False), utf8_atom, title_utf8); } if (mode == 'T' || mode == 'I') { if (title_local) { replace_prop(disp, win, XA_WM_ICON_NAME, XA_STRING, title_local); } else { XDeleteProperty(disp, win, XA_WM_ICON_NAME); } replace_prop(disp, win, XInternAtom(disp, "_NET_WM_ICON_NAME", False), utf8_atom, title_utf8); } sfree(title_utf8); sfree(title_local); }
void remove_client(Client *c) { Client *p; LOG_DEBUG("remove_client() : Removing...\n"); if (!c || !c->xstuff) return; XGrabServer(dpy); ignore_xerror = 1; /* ICCCM 4.1.3.1 * "When the window is withdrawn, the window manager will either * change the state field's value to WithdrawnState or it will * remove the WM_STATE property entirely." * EWMH 1.3 * "The Window Manager should remove the property whenever a * window is withdrawn but it should leave the property in * place when it is shutting down." (both _NET_WM_DESKTOP and * _NET_WM_STATE) */ if (c->remove) { LOG_DEBUG("\tremove_client() : setting WithdrawnState\n"); set_wm_state(c, WithdrawnState); XDeleteProperty(dpy, c->xstuff->window, xa_net_wm_desktop); XDeleteProperty(dpy, c->xstuff->window, xa_net_wm_state); } ungravitate(c); if (c->xstuff->screen) XReparentWindow(dpy, c->xstuff->window, c->xstuff->screen->root, c->x, c->y); XSetWindowBorderWidth(dpy, c->xstuff->window, c->old_border); XRemoveFromSaveSet(dpy, c->xstuff->window); if (c->xstuff->parent) XDestroyWindow(dpy, c->xstuff->parent); if (head_client == c) head_client = c->next; else for (p = head_client; p && p->next; p = p->next) if (p->next == c) p->next = c->next; if (current == c) current = NULL; /* an enter event should set this up again */ free(c->xstuff); free(c); #ifdef DEBUG { Client *pp; int i = 0; for (pp = head_client; pp; pp = pp->next) i++; LOG_DEBUG("\tremove_client() : free(), window count now %d\n", i); } #endif XUngrabServer(dpy); XFlush(dpy); ignore_xerror = 0; LOG_DEBUG("remove_client() returning\n"); }
void window_set_title( Display * disp, Window win, char *title, char mode ) { gchar *title_utf8; gchar *title_local; if ( envir_utf8 ) { title_utf8 = g_strdup( title ); title_local = NULL; } else { if ( !( title_utf8 = g_locale_to_utf8( title, -1, NULL, NULL, NULL ) ) ) { title_utf8 = g_strdup( title ); } title_local = g_strdup( title ); } if ( mode == 'T' || mode == 'N' ) { /* set name */ if ( title_local ) { XChangeProperty( disp, win, XA_WM_NAME, XA_STRING, 8, PropModeReplace, ( unsigned char * ) title_local, strlen( title_local ) ); } else { XDeleteProperty( disp, win, XA_WM_NAME ); } XChangeProperty( disp, win, XInternAtom( disp, "_NET_WM_NAME", False ), XInternAtom( disp, "UTF8_STRING", False ), 8, PropModeReplace, ( unsigned char * ) title_utf8, strlen( title_utf8 ) ); } if ( mode == 'T' || mode == 'I' ) { /* set icon name */ if ( title_local ) { XChangeProperty( disp, win, XA_WM_ICON_NAME, XA_STRING, 8, PropModeReplace, ( unsigned char * ) title_local, strlen( title_local ) ); } else { XDeleteProperty( disp, win, XA_WM_ICON_NAME ); } XChangeProperty( disp, win, XInternAtom( disp, "_NET_WM_ICON_NAME", False ), XInternAtom( disp, "UTF8_STRING", False ), 8, PropModeReplace, ( unsigned char * ) title_utf8, strlen( title_utf8 ) ); } g_free( title_utf8 ); g_free( title_local ); }
void DeleteXloginResources(struct display *d, Display * dpy) { int i; Atom prop = XInternAtom(dpy, "SCREEN_RESOURCES", True); XDeleteProperty(dpy, RootWindow(dpy, 0), XA_RESOURCE_MANAGER); if (prop) { for (i = ScreenCount(dpy); --i >= 0;) XDeleteProperty(dpy, RootWindow(dpy, i), prop); } }
void update_strut(Panel* p) { if (panel_strut_policy == STRUT_NONE) { XDeleteProperty(server.dsp, p->main_win, server.atom._NET_WM_STRUT); XDeleteProperty(server.dsp, p->main_win, server.atom._NET_WM_STRUT_PARTIAL); return; } // Reserved space unsigned int d1, screen_width, screen_height; Window d2; int d3; XGetGeometry(server.dsp, server.root_win, &d2, &d3, &d3, &screen_width, &screen_height, &d1, &d1); Monitor monitor = server.monitor[p->monitor]; long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (panel_horizontal) { int height = p->area.height + p->marginy; if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) ) height = p->hidden_height; if (panel_position & TOP) { struts[2] = height + monitor.y; struts[8] = p->posx; // p->area.width - 1 allowed full screen on monitor 2 struts[9] = p->posx + p->area.width - 1; } else { struts[3] = height + screen_height - monitor.y - monitor.height; struts[10] = p->posx; // p->area.width - 1 allowed full screen on monitor 2 struts[11] = p->posx + p->area.width - 1; } } else { int width = p->area.width + p->marginx; if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) ) width = p->hidden_width; if (panel_position & LEFT) { struts[0] = width + monitor.x; struts[4] = p->posy; // p->area.width - 1 allowed full screen on monitor 2 struts[5] = p->posy + p->area.height - 1; } else { struts[1] = width + screen_width - monitor.x - monitor.width; struts[6] = p->posy; // p->area.width - 1 allowed full screen on monitor 2 struts[7] = p->posy + p->area.height - 1; } } // Old specification : fluxbox need _NET_WM_STRUT. XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_STRUT, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &struts, 4); XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_STRUT_PARTIAL, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &struts, 12); }
void setopacity(Client *c, unsigned int opacity) { if (opacity == OPAQUE) { XDeleteProperty(dpy, c->win, atom[WindowOpacity]); XDeleteProperty(dpy, c->frame, atom[WindowOpacity]); } else { XChangeProperty(dpy, c->win, atom[WindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); XChangeProperty(dpy, c->frame, atom[WindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); } }
void remove_sm_from_client_leader() { #ifdef Q_WS_X11 Atom type; int format, status; unsigned long nitems = 0; unsigned long extra = 0; unsigned char *data = 0; Atom atoms[ 2 ]; char *atom_names[ 2 ] = { ( char * ) "WM_CLIENT_LEADER", ( char * ) "SM_CLIENT_ID" }; XInternAtoms( QX11Info::display(), atom_names, 2, False, atoms ); QWidget w; KXErrorHandler handler; // ignore X errors status = XGetWindowProperty( QX11Info::display(), w.winId(), atoms[ 0 ], 0, 10000, false, XA_WINDOW, &type, &format, &nitems, &extra, &data ); if ( ( status == Success ) && !handler.error( false ) ) { if ( data && ( nitems > 0 ) ) { Window leader = * ( ( Window * ) data ); XDeleteProperty( QX11Info::display(), leader, atoms[ 1 ] ); } XFree( data ); } #endif }
EAPI void ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XDeleteProperty(_ecore_x_disp, win, property); }
static void hd_incoming_event_window_set_string_xwindow_property (GtkWidget *widget, const gchar *prop, const gchar *value) { Atom atom; GdkWindow *window; GdkDisplay *dpy; /* Check if widget is realized. */ if (!GTK_WIDGET_REALIZED (widget)) return; window = widget->window; dpy = gdk_drawable_get_display (window); atom = gdk_x11_get_xatom_by_name_for_display (dpy, prop); if (value) { /* Set property to given value */ XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), atom, XA_STRING, 8, PropModeReplace, (const guchar *)value, strlen (value)); } else { /* Delete property if no value is given */ XDeleteProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), atom); } }
void ScreenSaver::setScreenSaverInhibited(bool inhibited) { Q_D(ScreenSaver); d->inhibited = inhibited; if ((!d->complete) || (!d->windowId)) { return; } Atom atom = XInternAtom(QX11Info::display() , "_HILDON_DO_NOT_DISTURB", False); if (inhibited) { long state = 1; XChangeProperty( QX11Info::display(), d->windowId, atom, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &state, 1); } else { XDeleteProperty(QX11Info::display(), d->windowId, atom); } }
void XmuDeleteStandardColormap(Display *dpy, int screen, Atom property) /* dpy; - specifies the X server to connect to * screen - specifies the screen of the display * property - specifies the standard colormap property */ { XStandardColormap *stdcmaps, *s; int count = 0; if (XGetRGBColormaps(dpy, RootWindow(dpy, screen), &stdcmaps, &count, property)) { for (s=stdcmaps; count > 0; count--, s++) { if ((s->killid == ReleaseByFreeingColormap) && (s->colormap != None) && (s->colormap != DefaultColormap(dpy, screen))) XFreeColormap(dpy, s->colormap); else if (s->killid != None) XKillClient(dpy, s->killid); } XDeleteProperty(dpy, RootWindow(dpy, screen), property); XFree((char *) stdcmaps); XSync(dpy, False); } }
void gui_paste(struct gui_instance *gi, enum gui_clipboard source) { Window selowner; Atom selection; switch (source) { case GUI_PRIMARY_SELECTION: selection = XA_PRIMARY; break; case GUI_SECONDARY_SELECTION: selection = XA_SECONDARY; break; case GUI_CLIPBOARD: selection = xa_clipboard; break; default: return; } selowner = XGetSelectionOwner(GUI_display, selection); if (selowner == None) { fprintf (stderr, "No selection owner\n"); return; } XDeleteProperty(GUI_display, gi->window, xa_prop_paste); XConvertSelection(GUI_display, selection, xa_utf8_string, xa_prop_paste, gi->window, CurrentTime); }
static inline void set_wm_title (ClutterStageX11 *stage_x11) { ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin == None || stage_x11->is_foreign_xwin) return; if (stage_x11->title == NULL) { XDeleteProperty (backend_x11->xdpy, stage_x11->xwin, backend_x11->atom_NET_WM_NAME); } else { XChangeProperty (backend_x11->xdpy, stage_x11->xwin, backend_x11->atom_NET_WM_NAME, backend_x11->atom_UTF8_STRING, 8, PropModeReplace, (unsigned char *) stage_x11->title, (int) strlen (stage_x11->title)); } }
/** * Remove the transient_for setting from a window. * @param win The window */ EAPI void ecore_x_icccm_transient_for_unset(Ecore_X_Window win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR); if (_ecore_xlib_sync) ecore_x_sync(); }
void xkl_engine_set_toplevel_window_transparent(XklEngine * engine, Window toplevel_win, gboolean transparent) { gboolean oldval; oldval = xkl_engine_is_toplevel_window_transparent(engine, toplevel_win); xkl_debug(150, "toplevel_win " WINID_FORMAT " was %stransparent\n", toplevel_win, oldval ? "" : "not "); if (transparent && !oldval) { CARD32 prop = 1; XChangeProperty(xkl_engine_get_display(engine), toplevel_win, xkl_engine_priv(engine, atoms) [XKLAVIER_TRANSPARENT], XA_INTEGER, 32, PropModeReplace, (const unsigned char *) &prop, 1); } else if (!transparent && oldval) { XDeleteProperty(xkl_engine_get_display(engine), toplevel_win, xkl_engine_priv(engine, atoms) [XKLAVIER_TRANSPARENT]); } }
/** * hd_home_plugin_item_set_settings: * @item: A #HDHomePluginItem * @settings: Whether the applet supports settings * * Sets whether the applet should show a settings button in layout mode. * * The applet should connect to the #HDHomePluginItem::show-settings signal * to get notified when it should show the settings dialog. * **/ void hd_home_plugin_item_set_settings (HDHomePluginItem *item, gboolean settings) { g_return_if_fail (HD_IS_HOME_PLUGIN_ITEM (item)); item->priv->settings = settings; if (gtk_widget_get_realized (GTK_WIDGET (item))) { GdkWindow *window; GdkDisplay *display; window = gtk_widget_get_window (GTK_WIDGET (item)); display = gdk_window_get_display (window); /* Set or remove settings property from the window */ if (item->priv->settings) XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_APPLET_SETTINGS"), XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &(item->priv->settings), 1); else XDeleteProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_APPLET_SETTINGS")); } }
/*! Enables / disables the Swipe of the Harmattan. This is used on sorting mode when the user can drag item over the edge of the UI. */ void QtHelper::enableSwipe(bool enable) { #ifdef Q_WS_HARMATTAN QWidget *activeWindow = QApplication::activeWindow(); Display *dpy = QX11Info::display(); Atom atom; if (!activeWindow) { return; } atom = XInternAtom(dpy, "_MEEGOTOUCH_CUSTOM_REGION", False); if (enable) { XDeleteProperty(dpy, activeWindow->effectiveWinId(), atom); } else { unsigned int customRegion[] = { activeWindow->x(), activeWindow->y(), activeWindow->width(), activeWindow->height() }; XChangeProperty(dpy, activeWindow->winId(), atom, XA_CARDINAL, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&customRegion[0]), 4); } #endif }
/** * Cleanup and exit ctwm */ void DoShutdown(void) { #ifdef SOUNDS // Denounce ourselves play_exit_sound(); #endif // Restore windows/colormaps for our absence. RestoreForShutdown(CurrentTime); #ifdef EWMH // Clean up EWMH properties EwmhTerminate(); #endif // Clean up our list of workspaces XDeleteProperty(dpy, Scr->Root, XA_WM_WORKSPACESLIST); // Shut down captive stuff if(CLarg.is_captive) { RemoveFromCaptiveList(Scr->captivename); } // Close up shop XCloseDisplay(dpy); exit(0); }
void close_x11(void) { int i, scr_count; struct client *cnode; if(!dpy) return; if(verbose) { printf("closing X11 connection to display \"%s\"\n", getenv("DISPLAY")); } /* first delete all the CommandEvent properties from all root windows */ scr_count = ScreenCount(dpy); for(i=0; i<scr_count; i++) { Window root = RootWindow(dpy, i); XDeleteProperty(dpy, root, event_cmd); } XDestroyWindow(dpy, win); XCloseDisplay(dpy); dpy = 0; /* also remove all x11 clients from the client list */ cnode = client_list; while(cnode->next) { if(cnode->next->type == CLIENT_X11) { struct client *tmp = cnode->next; cnode->next = tmp->next; free(tmp); } else { cnode = cnode->next; } } }
void OS_X11::set_icon(const Image& p_icon) { if (!p_icon.empty()) { Image img=p_icon; img.convert(Image::FORMAT_RGBA); int w = img.get_width(); int h = img.get_height(); // We're using long to have wordsize (32Bit build -> 32 Bits, 64 Bit build -> 64 Bits Vector<long> pd; pd.resize(2+w*h); pd[0]=w; pd[1]=h; DVector<uint8_t>::Read r = img.get_data().read(); long * wr = &pd[2]; uint8_t const * pr = r.ptr(); for(int i=0;i<w*h;i++) { long v=0; // A R G B v|=pr[3] << 24 | pr[0] << 16 | pr[1] << 8 | pr[2]; *wr++=v; pr += 4; } XChangeProperty(x11_display, x11_window, net_wm_icon, XA_CARDINAL, 32, PropModeReplace, (unsigned char*) pd.ptr(), pd.size()); } else { XDeleteProperty(x11_display, x11_window, net_wm_icon); } XFlush(x11_display); }
/* * Deletes the state from the window properties */ void xkl_engine_remove_toplevel_window_state(XklEngine * engine, Window toplevel_win) { XDeleteProperty(xkl_engine_get_display(engine), toplevel_win, xkl_engine_priv(engine, atoms)[XKLAVIER_STATE]); }
/* * groupUpdateWindowProperty * */ void groupUpdateWindowProperty (CompWindow *w) { CompDisplay *d = &display; GROUP_WINDOW (w); GROUP_DISPLAY (d); // Do not change anything in this case if (gw->readOnlyProperty) return; if (gw->group) { long int buffer[5]; buffer[0] = gw->group->identifier; buffer[1] = (gw->slot) ? TRUE : FALSE; /* group color RGB */ buffer[2] = gw->group->color[0]; buffer[3] = gw->group->color[1]; buffer[4] = gw->group->color[2]; XChangeProperty (d->display, w->id, gd->groupWinPropertyAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) buffer, 5); } else { XDeleteProperty (d->display, w->id, gd->groupWinPropertyAtom); } }
bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha) { GdkWindow* window = NULL; if (m_widget) window = gtk_widget_get_window(m_widget); if (window == NULL) return false; #ifdef GDK_WINDOWING_X11 Display* dpy = GDK_WINDOW_XDISPLAY(window); Window win = GDK_WINDOW_XID(window); // Using pure Xlib to not have a GTK version check mess due to gtk2.0 not having GdkDisplay if (alpha == 0xff) XDeleteProperty(dpy, win, XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False)); else { long opacity = alpha * 0x1010101L; XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity, 1L); } XSync(dpy, False); return true; #else // !GDK_WINDOWING_X11 return false; #endif // GDK_WINDOWING_X11 / !GDK_WINDOWING_X11 }
void xu_ewmh_set_net_wm_state(struct client_ctx *cc) { Atom *atoms, *oatoms; int n, i, j; oatoms = xu_ewmh_get_net_wm_state(cc, &n); atoms = xmalloc((n + _NET_WM_STATES_NITEMS) * sizeof(Atom)); for (i = j = 0; i < n; i++) { if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ].atom && oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT].atom) atoms[j++] = oatoms[i]; } free(oatoms); if (cc->flags & CLIENT_HMAXIMIZED) atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_HORZ].atom; if (cc->flags & CLIENT_VMAXIMIZED) atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_VERT].atom; if (j > 0) XChangeProperty(X_Dpy, cc->win, ewmh[_NET_WM_STATE].atom, XA_ATOM, 32, PropModeReplace, (unsigned char *)atoms, j); else XDeleteProperty(X_Dpy, cc->win, ewmh[_NET_WM_STATE].atom); free(atoms); }
//============================================================================== // Read the content of a window property as either a locale-dependent string or an utf8 string // works only for strings shorter than 1000000 bytes static String readWindowProperty (Window window, Atom prop, Atom fmt) { String returnData; char* clipData; Atom actualType; int actualFormat; unsigned long numItems, bytesLeft; if (XGetWindowProperty (display, window, prop, 0L /* offset */, 1000000 /* length (max) */, False, AnyPropertyType /* format */, &actualType, &actualFormat, &numItems, &bytesLeft, (unsigned char**) &clipData) == Success) { if (actualType == atom_UTF8_STRING && actualFormat == 8) returnData = String::fromUTF8 (clipData, numItems); else if (actualType == XA_STRING && actualFormat == 8) returnData = String (clipData, numItems); if (clipData != nullptr) XFree (clipData); jassert (bytesLeft == 0 || numItems == 1000000); } XDeleteProperty (display, window, prop); return returnData; }
void xu_ewmh_set_net_wm_state(struct client_ctx *cc) { Atom *atoms, *oatoms; int n, i, j; oatoms = xu_ewmh_get_net_wm_state(cc, &n); atoms = xcalloc((n + _NET_WM_STATES_NITEMS), sizeof(Atom)); for (i = j = 0; i < n; i++) { if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] && oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT] && oatoms[i] != ewmh[_NET_WM_STATE_FULLSCREEN] && oatoms[i] != ewmh[_NET_WM_STATE_DEMANDS_ATTENTION]) atoms[j++] = oatoms[i]; } free(oatoms); if (cc->flags & CLIENT_FULLSCREEN) atoms[j++] = ewmh[_NET_WM_STATE_FULLSCREEN]; else { if (cc->flags & CLIENT_HMAXIMIZED) atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_HORZ]; if (cc->flags & CLIENT_VMAXIMIZED) atoms[j++] = ewmh[_NET_WM_STATE_MAXIMIZED_VERT]; } if (cc->flags & CLIENT_URGENCY) atoms[j++] = ewmh[_NET_WM_STATE_DEMANDS_ATTENTION]; if (j > 0) XChangeProperty(X_Dpy, cc->win, ewmh[_NET_WM_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char *)atoms, j); else XDeleteProperty(X_Dpy, cc->win, ewmh[_NET_WM_STATE]); free(atoms); }
void DeleteRootAtoms(Display *dpy2, Window root2) { Atom type; int format; unsigned long length, after; unsigned char *data; Bool e_deleted = False; XA_XSETROOT_ID = XInternAtom(dpy2, "_XSETROOT_ID", False); XA_ESETROOT_PMAP_ID = XInternAtom(dpy2, "ESETROOT_PMAP_ID", False); XA_XROOTPMAP_ID = XInternAtom(dpy2, "_XROOTPMAP_ID", False); if (XGetWindowProperty( dpy2, root2, XA_XSETROOT_ID, 0L, 1L, True, XA_PIXMAP, &type, &format, &length, &after, &data) == Success && type == XA_PIXMAP && format == 32 && length == 1 && after == 0 && (Pixmap)(*(long *)data) != None) { XKillClient(dpy2, *((Pixmap *)data)); } if (XGetWindowProperty( dpy2, root2, XA_ESETROOT_PMAP_ID, 0L, 1L, True, XA_PIXMAP, &type, &format, &length, &after, &data) == Success && type == XA_PIXMAP && format == 32 && length == 1 && after == 0 && (Pixmap)(*(Pixmap *)data) != None) { e_deleted = True; XKillClient(dpy2, *((Pixmap *)data)); } if (e_deleted) { XDeleteProperty(dpy2, root2, XA_XROOTPMAP_ID); } }
void open_program(Char *c, Char *title, int (*func)(unsigned char*, unsigned int*)) { /* c contains the commandline that should be executed. * It should contain a %i (or %x) at the location where the window-id * should be inserted * It has to be a shell script of the form: * xpipeout -window wid | command | xpipein -window wid */ EDITINFO *edata; char callbuf[1024]; as_icon=1; edit_open(); as_icon=0; if (state_window) { edata=state_window; edata->shell=1; edata->callback=func; sprintf(callbuf, (char*)UstrtoLocale(c), edata->win_id, edata->win_id); XChangeProperty(display, edata->win_id, intestat, textat, 8, PropModeReplace, (unsigned char*)"Yes", 3); XDeleteProperty(display, edata->win_id, outputat); XFlush(display); system(callbuf); /* wait until program is ready to read. */ edata->view_mode=MP_True; set_name(edata, concat(title,NULL)); } }
void x11PropertyNotify(Window w) { if (m_pWidget && m_wOwner == w) { // Always check whether our property-flag is still around... Atom aType; int iFormat = 0; unsigned long iItems = 0; unsigned long iAfter = 0; unsigned char *pData = 0; if (XGetWindowProperty( m_pDisplay, m_wOwner, m_aUnique, 0, 1024, false, m_aUnique, &aType, &iFormat, &iItems, &iAfter, &pData) == Success && aType == m_aUnique && iItems > 0 && iAfter == 0) { // Avoid repeating it-self... XDeleteProperty(m_pDisplay, m_wOwner, m_aUnique); // Just make it always shows up fine... m_pWidget->show(); m_pWidget->raise(); m_pWidget->activateWindow(); } // Free any left-overs... if (iItems > 0 && pData) XFree(pData); } }
void ewmh_destroy() { g_free(g_windows); if (g_original_clients) { XFree(g_original_clients); } XDeleteProperty(g_display, g_root, g_netatom[NetSupportingWmCheck]); XDestroyWindow(g_display, g_wm_window); }