mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 14:46:00 +01:00
Fix some mutex deprecation warnings in page-widget
According to my compiler output and the page on glib deprecated APIs [1], some of the stuff needed to be removed or changed. [1] - http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com> Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
bb8bfc0dd3
commit
7dd30a42cf
1 changed files with 6 additions and 8 deletions
|
@ -22,7 +22,7 @@ typedef struct zathura_page_widget_private_s {
|
||||||
zathura_t* zathura; /**< Zathura object */
|
zathura_t* zathura; /**< Zathura object */
|
||||||
cairo_surface_t* surface; /**< Cairo surface */
|
cairo_surface_t* surface; /**< Cairo surface */
|
||||||
gint64 last_view; /**< Last time the page has been viewed */
|
gint64 last_view; /**< Last time the page has been viewed */
|
||||||
GStaticMutex lock; /**< Lock */
|
GMutex lock; /**< Lock */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
girara_list_t* list; /**< List of links on the page */
|
girara_list_t* list; /**< List of links on the page */
|
||||||
|
@ -162,7 +162,7 @@ zathura_page_widget_init(ZathuraPage* widget)
|
||||||
priv->mouse.selection_basepoint.x = -1;
|
priv->mouse.selection_basepoint.x = -1;
|
||||||
priv->mouse.selection_basepoint.y = -1;
|
priv->mouse.selection_basepoint.y = -1;
|
||||||
|
|
||||||
g_static_mutex_init(&(priv->lock));
|
g_mutex_init(&(priv->lock));
|
||||||
|
|
||||||
/* we want mouse events */
|
/* we want mouse events */
|
||||||
gtk_widget_add_events(GTK_WIDGET(widget),
|
gtk_widget_add_events(GTK_WIDGET(widget),
|
||||||
|
@ -195,8 +195,6 @@ zathura_page_widget_finalize(GObject* object)
|
||||||
girara_list_free(priv->links.list);
|
girara_list_free(priv->links.list);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_static_mutex_free(&(priv->lock));
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object);
|
G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ static gboolean
|
||||||
zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
|
zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
|
||||||
{
|
{
|
||||||
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
||||||
g_static_mutex_lock(&(priv->lock));
|
g_mutex_lock(&(priv->lock));
|
||||||
|
|
||||||
zathura_document_t* document = zathura_page_get_document(priv->page);
|
zathura_document_t* document = zathura_page_get_document(priv->page);
|
||||||
|
|
||||||
|
@ -466,7 +464,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
|
||||||
/* render real page */
|
/* render real page */
|
||||||
render_page(priv->zathura->sync.render_thread, priv->page);
|
render_page(priv->zathura->sync.render_thread, priv->page);
|
||||||
}
|
}
|
||||||
g_static_mutex_unlock(&(priv->lock));
|
g_mutex_unlock(&(priv->lock));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,13 +479,13 @@ void
|
||||||
zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface)
|
zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface)
|
||||||
{
|
{
|
||||||
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
|
||||||
g_static_mutex_lock(&(priv->lock));
|
g_mutex_lock(&(priv->lock));
|
||||||
if (priv->surface != NULL) {
|
if (priv->surface != NULL) {
|
||||||
cairo_surface_finish(priv->surface);
|
cairo_surface_finish(priv->surface);
|
||||||
cairo_surface_destroy(priv->surface);
|
cairo_surface_destroy(priv->surface);
|
||||||
}
|
}
|
||||||
priv->surface = surface;
|
priv->surface = surface;
|
||||||
g_static_mutex_unlock(&(priv->lock));
|
g_mutex_unlock(&(priv->lock));
|
||||||
/* force a redraw here */
|
/* force a redraw here */
|
||||||
zathura_page_widget_redraw_canvas(widget);
|
zathura_page_widget_redraw_canvas(widget);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue