void frame_release_client(struct wm_frame *self) { if(!xqueue_exists_local(find_reparent, self)) { XReparentWindow(t_display, self->client->window, DefaultRootWindow(t_display), self->client->area.x, self->client->area.y); } window_remove(self->window); }
void popup_free(ObPopup *self) { if (self) { popup_hide(self); /* make sure it's not showing or is being delayed and will be shown */ XDestroyWindow(obt_display, self->bg); XDestroyWindow(obt_display, self->text); RrAppearanceFree(self->a_bg); RrAppearanceFree(self->a_text); window_remove(self->bg); stacking_remove(self); g_slice_free(ObPopup, self); } }
void dfb_window_deinit( CoreWindow *window ) { CoreWindowStack *stack = window->stack; DEBUGMSG("DirectFB/core/windows: dfb_window_deinit (%p) entered\n", window); if (stack) { stack_lock( stack ); window_remove( window ); stack_unlock( stack ); } DEBUGMSG("DirectFB/core/windows: dfb_window_deinit (%p) exitting\n", window); }
void menu_frame_free(ObMenuFrame *self) { if (self) { while (self->entries) { menu_entry_frame_free(self->entries->data); self->entries = g_list_delete_link(self->entries, self->entries); } stacking_remove(MENUFRAME_AS_WINDOW(self)); window_remove(self->window); RrAppearanceFree(self->a_items); XDestroyWindow(obt_display, self->window); g_slice_free(ObMenuFrame, self); } }
void prompt_unref(ObPrompt *self) { if (self && --self->ref == 0) { gint i; if (self->mapped) prompt_hide(self); prompt_list = g_list_remove(prompt_list, self); obt_keyboard_context_unref(self->ic); for (i = 0; i < self->n_buttons; ++i) { window_remove(self->button[i].window); XDestroyWindow(obt_display, self->button[i].window); } XDestroyWindow(obt_display, self->msg.window); XDestroyWindow(obt_display, self->super.window); g_slice_free(ObPrompt, self); } }
static void menu_entry_frame_free(ObMenuEntryFrame *self) { if (self) { window_remove(self->window); XDestroyWindow(obt_display, self->text); XDestroyWindow(obt_display, self->window); g_hash_table_remove(menu_frame_map, &self->text); g_hash_table_remove(menu_frame_map, &self->window); if ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) || (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) { XDestroyWindow(obt_display, self->icon); g_hash_table_remove(menu_frame_map, &self->icon); } if (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) { XDestroyWindow(obt_display, self->bullet); g_hash_table_remove(menu_frame_map, &self->bullet); } menu_entry_unref(self->entry); g_slice_free(ObMenuEntryFrame, self); } }
/** * Retrieves and processes single X event. */ static int process_event(int slice) { xevent_t e; struct timeval tv = { 0, slice * 1000 }; if (!options.abort_wait && xhandler_get_xevent_timed(&e.ev, &tv)) { if (e.ev.type == xhandler.damage_event_num + XDamageNotify) { XDamageNotifyEvent *dev = &e.dev; int xpos = dev->area.x + dev->geometry.x; int ypos = dev->area.y + dev->geometry.y; /* check if the damage are is in the monitoring area */ if (xpos + dev->area.width >= options.interested_damage_rect.x && xpos <= (options.interested_damage_rect.x + options.interested_damage_rect.width) && ypos + dev->area.height >= options.interested_damage_rect.y && ypos <= (options.interested_damage_rect.y + options.interested_damage_rect.height)) { if (!match_exclude_rules(dev)) { window_t* win = window_find(dev->drawable); report_add_message(dev->timestamp, "Got damage event %dx%d+%d+%d from 0x%lx (%s)\n", dev->area.width, dev->area.height, xpos, ypos, dev->drawable, win && win->application ? win->application->name : "unknown"); if (response.last_action_time) { window_t* win = window_find(dev->drawable); if (win && win->application) { application_register_damage(win->application, dev); } } } } XDamageSubtract(xhandler.display, dev->damage, None, None); } else if (e.ev.type == CreateNotify) { /* check new windows if we have to monitor them */ XCreateWindowEvent* ev = &e.cev; /* TODO: Check if we really must monitor only main windows. Probably done to avoid double reporting. We could avoid that by going through monitored window list, checking if this window is in the parent chain of any monitored window. If so, remove the child. Might be expensive though, but worth a try. */ if (ev->parent == DefaultRootWindow(xhandler.display)) { window_t* win = window_try_monitor(ev->window); if (win) { Time start = xhandler_get_server_time(); report_add_message(start, "Created window 0x%lx (%s)\n", ev->window, win->application ? win->application->name : "unknown"); } } } else if (e.ev.type == UnmapNotify) { XUnmapEvent* ev = &e.uev; window_t* win = window_find(ev->window); if (win) { Time start = xhandler_get_server_time(); report_add_message(start, "Unmapped window 0x%lx (%s)\n", ev->window, win->application ? win->application->name : "unknown"); } } else if (e.ev.type == MapNotify) { XMapEvent* ev = &e.mev; window_t* win = window_find(ev->window); if (win) { Time start = xhandler_get_server_time(); report_add_message(start, "Mapped window 0x%lx (%s)\n", ev->window, win->application ? win->application->name : "unknown"); } } else if (e.ev.type == DestroyNotify) { XDestroyWindowEvent* ev = (XDestroyWindowEvent*) &e.dstev; window_t* win = window_find(ev->window); if (win) { Time start = xhandler_get_server_time(); report_add_message(start, "Destroyed window 0x%lx (%s)\n", ev->window, win->application ? win->application->name : "unknown"); window_remove(win); } } else { /* remove to avoid reporting unwanted even types ? with window creation monitoring there are more unhandled event types */ /* fprintf(stderr, "Got unwanted event type %d\n", e.type); */ } return e.ev.type; } return 0; }