mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Android: Fixed session resizing
This commit is contained in:
@@ -83,10 +83,7 @@ void android_desktop_resize(rdpContext* context)
|
||||
DEBUG_ANDROID("ui_desktop_resize");
|
||||
|
||||
rdpGdi *gdi = context->gdi;
|
||||
rdpSettings* settings = context->instance->settings;
|
||||
|
||||
gdi_resize(gdi, settings->DesktopWidth, settings->DesktopHeight);
|
||||
freerdp_callback("OnGraphicsResize", "(III)V", context->instance, settings->DesktopWidth, settings->DesktopHeight);
|
||||
freerdp_callback("OnGraphicsResize", "(IIII)V", context->instance, gdi->width, gdi->height, gdi->dstBpp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -924,10 +924,13 @@ public class SessionActivity extends Activity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnGraphicsResize(int width, int height)
|
||||
public void OnGraphicsResize(int width, int height, int bpp)
|
||||
{
|
||||
// replace bitmap
|
||||
bitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
|
||||
if (bpp > 16)
|
||||
bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
|
||||
else
|
||||
bitmap = Bitmap.createBitmap(width, height, Config.RGB_565);
|
||||
session.setSurface(new BitmapDrawable(bitmap));
|
||||
|
||||
/* since sessionView can only be modified from the UI thread
|
||||
|
||||
@@ -64,7 +64,7 @@ public class LibFreeRDP
|
||||
boolean OnAuthenticate(StringBuilder username, StringBuilder domain, StringBuilder password);
|
||||
boolean OnVerifiyCertificate(String subject, String issuer, String fingerprint);
|
||||
void OnGraphicsUpdate(int x, int y, int width, int height);
|
||||
void OnGraphicsResize(int width, int height);
|
||||
void OnGraphicsResize(int width, int height, int bpp);
|
||||
}
|
||||
|
||||
private static EventListener listener;
|
||||
@@ -237,14 +237,14 @@ public class LibFreeRDP
|
||||
uiEventListener.OnGraphicsUpdate(x, y, width, height);
|
||||
}
|
||||
|
||||
private static void OnGraphicsResize(int inst, int width, int height)
|
||||
private static void OnGraphicsResize(int inst, int width, int height, int bpp)
|
||||
{
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return;
|
||||
UIEventListener uiEventListener = s.getUIEventListener();
|
||||
if (uiEventListener != null)
|
||||
uiEventListener.OnGraphicsResize(width, height);
|
||||
uiEventListener.OnGraphicsResize(width, height, bpp);
|
||||
}
|
||||
|
||||
public static String getVersion()
|
||||
|
||||
Reference in New Issue
Block a user