static GdkFilterReturn
filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
{
  XEvent *x_event;
  x_event = (XEvent *) gdk_xevent;

  switch (x_event->type) {
  case KeyPress:
    if (popup == NULL && popup_keycode_to_free == -1) {
      popup_keycode_to_free = x_event->xkey.keycode;
      popup = popup_create (screen);
    } else {
      popup_on_key_press (popup,
                          GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                          &x_event->xkey);
    }
    break;
  case KeyRelease:
    if (popup_keycode_to_free == x_event->xkey.keycode) {
      popup_keycode_to_free = -1;
      popup_free (popup);
      popup = NULL;
    }
    break;
  default:
    // No-op.
    break;
  }

  return GDK_FILTER_CONTINUE;
}
gboolean
superswitcher_hide_popup (void *object, GError **error)
{
  if (popup) {
    popup_free (popup);
    popup = NULL;
  }
  return TRUE;
}
Exemple #3
0
void icon_popup_free(ObIconPopup *self)
{
    if (self) {
        XDestroyWindow(obt_display, self->icon);
        RrAppearanceFree(self->a_icon);
        popup_free(self->popup);
        g_slice_free(ObIconPopup, self);
    }
}
Exemple #4
0
void moveresize_shutdown(gboolean reconfig)
{
    if (!reconfig) {
        if (moveresize_in_progress)
            moveresize_end(FALSE);
        client_remove_destroy_notify(client_dest);
    }

    popup_free(popup);
    popup = NULL;
}
Exemple #5
0
void pager_popup_free(ObPagerPopup *self)
{
    if (self) {
        guint i;

        for (i = 0; i < self->desks; ++i)
            XDestroyWindow(obt_display, self->wins[i]);
        g_free(self->wins);
        RrAppearanceFree(self->hilight);
        RrAppearanceFree(self->unhilight);
        popup_free(self->popup);
        g_slice_free(ObPagerPopup, self);
    }
}