[gtk-frdp/gtk-frdp-0-1] frdp-session: Don't register our own pointer
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-frdp/gtk-frdp-0-1] frdp-session: Don't register our own pointer
- Date: Mon, 4 Apr 2022 10:18:30 +0000 (UTC)
commit f18a0126ff881baf4274f932819a59c4267356fd
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Apr 1 13:02:20 2022 +0200
frdp-session: Don't register our own pointer
src/frdp-session.c | 129 -----------------------------------------------------
1 file changed, 129 deletions(-)
---
diff --git a/src/frdp-session.c b/src/frdp-session.c
index c753005..65c798c 100644
--- a/src/frdp-session.c
+++ b/src/frdp-session.c
@@ -154,133 +154,6 @@ frdp_session_update_mouse_pointer (FrdpSession *self)
gdk_window_set_cursor (window, cursor);
}
-static BOOL
-frdp_Pointer_New(rdpContext* context, rdpPointer* pointer)
-{
- frdpContext *fcontext = (frdpContext*) context;
- frdpPointer *fpointer = (frdpPointer*) pointer;
- int stride;
- unsigned char *data;
- cairo_surface_t *surface;
-
- if (!fcontext || !fpointer)
- return FALSE;
-
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, pointer->width,
- pointer->height);
- if (!surface) {
- return FALSE;
- }
-
- { /* FreeRDP BUG https://github.com/FreeRDP/FreeRDP/issues/5061
- * the function freerdp_image_copy_from_pointer_data
- * does not initialize the buffer which results in broken alpha data. */
- cairo_t* cairo = cairo_create (surface);
-
- cairo_set_source_rgba (cairo, 0.0, 0.0, 0.0, 1.0);
- cairo_fill (cairo);
- cairo_paint (cairo);
- cairo_destroy (cairo);
- }
-
- data = cairo_image_surface_get_data (surface);
- if (!data) {
- goto fail;
- }
-
- stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, pointer->width);
- if (!freerdp_image_copy_from_pointer_data (data, PIXEL_FORMAT_BGRA32,
- stride, 0, 0, pointer->width,
- pointer->height,
- pointer->xorMaskData,
- pointer->lengthXorMask,
- pointer->andMaskData,
- pointer->lengthAndMask,
- pointer->xorBpp,
- &context->gdi->palette))
- goto fail;
-
- fpointer->data = surface;
- return TRUE;
-fail:
- if (surface)
- cairo_surface_destroy (surface);
- return FALSE;
-}
-
-static void
-frdp_Pointer_Free (rdpContext* context, rdpPointer* pointer)
-{
- frdpPointer *fpointer = (frdpPointer*) pointer;
-
- if (fpointer && fpointer->data) {
- cairo_surface_destroy (fpointer->data);
- fpointer->data = NULL;
- }
-}
-
-static BOOL
-frdp_Pointer_Set (rdpContext* context,
- const rdpPointer* pointer)
-{
- frdpContext *fcontext = (frdpContext*) context;
- frdpPointer *fpointer = (frdpPointer*) pointer;
- FrdpSessionPrivate *priv = fcontext->self->priv;
-
- priv->cursor = fpointer;
- priv->cursor_null = FALSE;
-
- frdp_session_update_mouse_pointer (fcontext->self);
- return TRUE;
-}
-
-static BOOL
-frdp_Pointer_SetNull (rdpContext* context)
-{
- frdpContext *fcontext = (frdpContext*) context;
- FrdpSessionPrivate *priv = fcontext->self->priv;
-
- priv->cursor = NULL;
- priv->cursor_null = TRUE;
-
- frdp_session_update_mouse_pointer (fcontext->self);
-
- return TRUE;
-}
-
-static BOOL
-frdp_Pointer_SetDefault (rdpContext* context)
-{
- frdpContext *fcontext = (frdpContext*) context;
- FrdpSessionPrivate *priv = fcontext->self->priv;
-
- priv->cursor = NULL;
- priv->cursor_null = FALSE;
- frdp_session_update_mouse_pointer (fcontext->self);
- return TRUE;
-}
-
-static BOOL
-frdp_Pointer_SetPosition (rdpContext* context, UINT32 x, UINT32 y)
-{
- return TRUE;
-}
-
-static void
-frdp_register_pointer (rdpGraphics* graphics)
-{
- rdpPointer pointer;
-
- pointer.size = sizeof(frdpPointer);
- pointer.New = frdp_Pointer_New;
- pointer.Free = frdp_Pointer_Free;
- pointer.Set = frdp_Pointer_Set;
- pointer.SetNull = frdp_Pointer_SetNull;
- pointer.SetDefault = frdp_Pointer_SetDefault;
- pointer.SetPosition = frdp_Pointer_SetPosition;
- graphics_register_pointer(graphics, &pointer);
-}
-
static guint32
frdp_session_get_best_color_depth (FrdpSession *self)
{
@@ -470,8 +343,6 @@ frdp_post_connect (freerdp *freerdp_session)
gdi_init (freerdp_session, color_format);
gdi = freerdp_session->context->gdi;
- frdp_register_pointer (freerdp_session->context->graphics);
- pointer_cache_register_callbacks(freerdp_session->context->update);
freerdp_session->update->BeginPaint = frdp_begin_paint;
freerdp_session->update->EndPaint = frdp_end_paint;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]