Beispiel #1
0
void moveresize_end(gboolean cancel)
{
    ungrab_keyboard();
    ungrab_pointer();

    popup_hide(popup);

    if (!moving) {
#ifdef SYNC
        /* turn off the alarm */
        if (moveresize_alarm != None) {
            XSyncDestroyAlarm(obt_display, moveresize_alarm);
            moveresize_alarm = None;
        }

        if (sync_timer) g_source_remove(sync_timer);
        sync_timer = 0;
#endif
    }

    /* don't use client_move() here, use the same width/height as
       we've been using during the move, otherwise we get different results
       when moving maximized windows between monitors of different sizes !
    */
    client_configure(moveresize_client,
                     (cancel ? start_cx : cur_x),
                     (cancel ? start_cy : cur_y),
                     (cancel ? start_cw : cur_w),
                     (cancel ? start_ch : cur_h),
                     TRUE, TRUE, FALSE);

    /* restore the client's maximized state. do this after putting the window
       back in its original spot to minimize visible flicker */
    if (cancel && (was_max_horz || was_max_vert)) {
        const gboolean h = moveresize_client->max_horz;
        const gboolean v = moveresize_client->max_vert;

        client_maximize(moveresize_client, TRUE,
                        was_max_horz && was_max_vert ? 0 :
                        (was_max_horz ? 1 : 2));

        /* replace the premax values with the ones we had saved if
           the client doesn't have any already set */
        if (was_max_horz && !h) {
            moveresize_client->pre_max_area.x = pre_max_area.x;
            moveresize_client->pre_max_area.width = pre_max_area.width;
        }
        if (was_max_vert && !v) {
            moveresize_client->pre_max_area.y = pre_max_area.y;
            moveresize_client->pre_max_area.height = pre_max_area.height;
        }
    }

    /* dont edge warp after its ended */
    cancel_edge_warp();

    moveresize_in_progress = FALSE;
    moveresize_client = NULL;
}
static void popup_trigger (PlaylistWidgetData * data, gint pos)
{
    popup_hide (data);

    data->popup_pos = pos;
    data->popup_source = g_timeout_add (aud_get_int (NULL, "filepopup_delay") *
     100, (GSourceFunc) popup_show, data);
}
static void mouse_motion (void * user, GdkEventMotion * event, gint row)
{
    PlaylistWidgetData * data = (PlaylistWidgetData *) user;

    if (row < 0)
    {
        popup_hide (data);
        return;
    }

    if (aud_get_bool (NULL, "show_filepopup_for_tuple") && data->popup_pos != row)
        popup_trigger (data, row);
}
Beispiel #4
0
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);
    }
}
static void cancel_all (GtkWidget * list, PlaylistData * data)
{
    data->drag = FALSE;

    if (data->scroll)
    {
        data->scroll = 0;
        g_source_remove (data->scroll_source);
    }

    if (data->hover != -1)
    {
        data->hover = -1;
        gtk_widget_queue_draw (list);
    }

    popup_hide (list, data);
}
void ui_playlist_widget_scroll (GtkWidget * widget)
{
    PlaylistWidgetData * data = audgui_list_get_user (widget);
    g_return_if_fail (data);

    gint row = -1;

    if (gtk_widget_get_realized (widget))
    {
        gint x, y;
        audgui_get_mouse_coords (widget, & x, & y);
        row = audgui_list_row_at_point (widget, x, y);
    }

    /* Only update the info popup if it is already shown or about to be shown;
     * this makes sure that it doesn't pop up when the Audacious window isn't
     * even visible. */
    if (row >= 0 && (data->popup_source || data->popup_shown))
        popup_trigger (data, row);
    else
        popup_hide (data);
}
static void mouse_leave (void * user, GdkEventMotion * event, gint row)
{
    popup_hide ((PlaylistWidgetData *) user);
}