mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 21:16:00 +01:00
Remove mutex from page widget
This should not introduce any problems. All functions of the page widget are now called from the main thread. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
5b3e0b7fc7
commit
1d398dfaf0
1 changed files with 0 additions and 15 deletions
|
@ -7,7 +7,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#include "glib-compat.h"
|
|
||||||
#include "links.h"
|
#include "links.h"
|
||||||
#include "page-widget.h"
|
#include "page-widget.h"
|
||||||
#include "page.h"
|
#include "page.h"
|
||||||
|
@ -24,12 +23,6 @@ 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 */
|
||||||
ZathuraRenderRequest* render_request; /* Request object */
|
ZathuraRenderRequest* render_request; /* Request object */
|
||||||
/** Lock
|
|
||||||
*
|
|
||||||
* This mutex can probably be removed. All functions are now called from the
|
|
||||||
* main thread.
|
|
||||||
*/
|
|
||||||
mutex lock;
|
|
||||||
bool cached; /**< Cached state */
|
bool cached; /**< Cached state */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -197,8 +190,6 @@ 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;
|
||||||
|
|
||||||
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),
|
||||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK);
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK);
|
||||||
|
@ -249,8 +240,6 @@ zathura_page_widget_finalize(GObject* object)
|
||||||
girara_list_free(priv->links.list);
|
girara_list_free(priv->links.list);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_free(&(priv->lock));
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object);
|
G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +359,6 @@ 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);
|
||||||
mutex_lock(&(priv->lock));
|
|
||||||
|
|
||||||
zathura_document_t* document = zathura_page_get_document(priv->page);
|
zathura_document_t* document = zathura_page_get_document(priv->page);
|
||||||
const unsigned int page_height = gtk_widget_get_allocated_height(widget);
|
const unsigned int page_height = gtk_widget_get_allocated_height(widget);
|
||||||
|
@ -507,7 +495,6 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
|
||||||
/* render real page */
|
/* render real page */
|
||||||
zathura_render_request(priv->render_request, g_get_real_time());
|
zathura_render_request(priv->render_request, g_get_real_time());
|
||||||
}
|
}
|
||||||
mutex_unlock(&(priv->lock));
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +509,6 @@ 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);
|
||||||
mutex_lock(&(priv->lock));
|
|
||||||
if (priv->surface != NULL) {
|
if (priv->surface != NULL) {
|
||||||
cairo_surface_destroy(priv->surface);
|
cairo_surface_destroy(priv->surface);
|
||||||
priv->surface = NULL;
|
priv->surface = NULL;
|
||||||
|
@ -531,7 +517,6 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface
|
||||||
priv->surface = surface;
|
priv->surface = surface;
|
||||||
cairo_surface_reference(surface);
|
cairo_surface_reference(surface);
|
||||||
}
|
}
|
||||||
mutex_unlock(&(priv->lock));
|
|
||||||
/* force a redraw here */
|
/* force a redraw here */
|
||||||
if (priv->surface != NULL) {
|
if (priv->surface != NULL) {
|
||||||
zathura_page_widget_redraw_canvas(widget);
|
zathura_page_widget_redraw_canvas(widget);
|
||||||
|
|
Loading…
Reference in a new issue