Ejemplo n.º 1
0
/* Handler for "current-desktop" event from root window listener. */
static void pager_net_current_desktop(FbEv * ev, PagerPlugin * pg)
{
    desk_set_dirty(pg->desks[pg->current_desktop]);
    pg->current_desktop = get_net_current_desktop();
    if (pg->current_desktop >= pg->number_of_desktops)
        pg->current_desktop = 0;
    desk_set_dirty(pg->desks[pg->current_desktop]);
}
Ejemplo n.º 2
0
static void
do_net_current_desktop(FbEv *ev, pager *p)
{
    ENTER;
    desk_set_dirty(p->desks[p->curdesk]);
    p->curdesk =  get_net_current_desktop ();
    if (p->curdesk >= p->desknum)
        p->curdesk = 0;
    desk_set_dirty(p->desks[p->curdesk]);
    RET();
}
Ejemplo n.º 3
0
Archivo: pager.c Proyecto: g7/fbpanel
static void
do_net_current_desktop(FbEv *ev, pager_priv *pg)
{
    ENTER;
    desk_set_dirty(pg->desks[pg->curdesk]);
    gtk_widget_set_state(pg->desks[pg->curdesk]->da, GTK_STATE_NORMAL);
    //pager_paint_frame(pg, pg->curdesk, GTK_STATE_NORMAL);
    pg->curdesk =  get_net_current_desktop ();
    if (pg->curdesk >= pg->desknum)
        pg->curdesk = 0;
    desk_set_dirty(pg->desks[pg->curdesk]);
    gtk_widget_set_state(pg->desks[pg->curdesk]->da, GTK_STATE_SELECTED);
    //pager_paint_frame(pg, pg->curdesk, GTK_STATE_SELECTED);
    RET();
}
Ejemplo n.º 4
0
/* Upon realize and every resize creates a new backing pixmap of the appropriate size */
static gint
desk_configure_event (GtkWidget *widget, GdkEventConfigure *event, desk *d)
{
    Panel* p;
    int w, h;
    ENTER;
    DBG("d->no=%d %dx%d\n", d->no, widget->allocation.width, widget->allocation.height);
    if (d->pix)
        g_object_unref(d->pix);

    d->pix = gdk_pixmap_new(widget->window,
          widget->allocation.width,
          widget->allocation.height,
          -1);

    d->scalew = (gfloat)widget->allocation.height / (gfloat)gdk_screen_height();
    d->scaleh = (gfloat)widget->allocation.width  / (gfloat)gdk_screen_width();
    desk_set_dirty(d);

    p = d->pg->plugin->panel;
    //request best size
    if (p->orientation != ORIENT_HORIZ) {
        w = widget->allocation.width;
        h = (gfloat) w / d->pg->ratio;
    } else {
        h = widget->allocation.height;
        w = (gfloat) h * d->pg->ratio;
    }
    DBG("requesting %dx%d\n", w, h);
    gtk_widget_set_size_request(widget, w, h);

    RET(FALSE);
}
Ejemplo n.º 5
0
Archivo: pager.c Proyecto: g7/fbpanel
static inline void
desk_set_dirty_all(pager_priv *pg)
{
    int i;
    ENTER;
    for (i = 0; i < pg->desknum; i++)
        desk_set_dirty(pg->desks[i]);
    RET();
}
Ejemplo n.º 6
0
/* Mark the desktop on which a specified window resides for redraw. */
static void desk_set_dirty_by_win(PagerPlugin * pg, PagerTask * tk)
{
    if (task_is_visible(tk))
    {
        if (tk->desktop < pg->number_of_desktops)
            desk_set_dirty(pg->desks[tk->desktop]);
        else
            desk_set_dirty_all(pg);
    }
}
Ejemplo n.º 7
0
Archivo: pager.c Proyecto: g7/fbpanel
static inline void
desk_set_dirty_by_win(pager_priv *p, task *t)
{
    ENTER;
    if (t->nws.skip_pager || t->nwwt.desktop /*|| t->nwwt.dock || t->nwwt.splash*/ )
        RET();
    if (t->desktop < p->desknum)
        desk_set_dirty(p->desks[t->desktop]);
    else
        desk_set_dirty_all(p);
    RET();
}
Ejemplo n.º 8
0
Archivo: pager.c Proyecto: g7/fbpanel
static void
pager_bg_changed(FbBg *bg, pager_priv *pg)
{
    int i;

    ENTER;
    for (i = 0; i < pg->desknum; i++) {
        desk *d = pg->desks[i];
        desk_draw_bg(pg, d);
        desk_set_dirty(d);
    }
    RET();
}
Ejemplo n.º 9
0
/* Handler for configure_event on drawing area. */
static gboolean desk_configure_event(GtkWidget * widget, GdkEventConfigure * event, PagerDesk * d)
{
    /* Allocate pixmap and statistics buffer without border pixels. */
#if GTK_CHECK_VERSION(2,18,0)
    GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
    gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
    int new_pixmap_width = allocation->width;
    int new_pixmap_height = allocation->height;
#else
    int new_pixmap_width = widget->allocation.width;
    int new_pixmap_height = widget->allocation.height;
#endif
    if ((new_pixmap_width > 0) && (new_pixmap_height > 0))
    {
        /* Allocate a new pixmap of the allocated size. */
        if (d->pixmap != NULL)
            cairo_surface_destroy(d->pixmap);
        d->pixmap = cairo_image_surface_create(CAIRO_FORMAT_RGB24, new_pixmap_width, new_pixmap_height);
        cairo_t *cr = cairo_create(d->pixmap);
        cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
        cairo_paint(cr);
	check_cairo_status(cr);
        cairo_destroy(cr);
	check_cairo_surface_status(&d->pixmap);

        /* Compute the horizontal and vertical scale factors, and mark the desktop for redraw. */
#if GTK_CHECK_VERSION(2,18,0)
        d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height();
        d->scale_x = (gfloat) allocation->width  / (gfloat) gdk_screen_width();
#else
        d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height();
        d->scale_x = (gfloat) allocation->width  / (gfloat) gdk_screen_width();
#endif
        desk_set_dirty(d);
     }

    /* Resize to optimal size. */
    gtk_widget_set_size_request(widget,
        (d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2) * d->pg->aspect_ratio,
        d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2);
#if GTK_CHECK_VERSION(2,18,0)
    g_free (allocation);
#endif
    return FALSE;
}
Ejemplo n.º 10
0
Archivo: pager.c Proyecto: g7/fbpanel
/* Upon realize and every resize creates a new backing pixmap of the appropriate size */
static gint
desk_configure_event (GtkWidget *widget, GdkEventConfigure *event, desk *d)
{
    int w, h;

    ENTER;
    w = widget->allocation.width;
    h = widget->allocation.height;

    DBG("d->no=%d %dx%d %dx%d\n", d->no, w, h, d->pg->daw, d->pg->dah);
    if (d->pix)
        g_object_unref(d->pix);
    if (d->gpix)
        g_object_unref(d->gpix);
    d->pix = gdk_pixmap_new(widget->window, w, h, -1);
    if (d->pg->wallpaper) {
        d->gpix = gdk_pixmap_new(widget->window, w, h, -1);
        desk_draw_bg(d->pg, d);
    }
    d->scalew = (gfloat)h / (gfloat)gdk_screen_height();
    d->scaleh = (gfloat)w / (gfloat)gdk_screen_width();
    desk_set_dirty(d);
    RET(FALSE);
}
Ejemplo n.º 11
0
/* Mark all desktops for redraw. */
static void desk_set_dirty_all(PagerPlugin * pg)
{
    int i;
    for (i = 0; i < pg->number_of_desktops; i++)
        desk_set_dirty(pg->desks[i]);
}