* java/org/gnu/emacs/EmacsService.java (sync): Delete function.
* java/org/gnu/emacs/EmacsView.java (handleDirtyBitmap): Erase
with window background.
(onDetachedFromWindow): Only recycle bitmap if non-NULL.
* java/org/gnu/emacs/EmacsWindow.java (background): New field.
(changeWindowBackground): Set it.
* src/android.c (struct android_emacs_service): Remove `sync'.
(android_init_emacs_service): Likewise.
(android_sync): Delete function.
* src/androidfns.c (android_create_tip_frame): Set frame
background color correctly.
(Fx_show_tip): Make the tip frame visible.
* src/androidgui.h: Update prototypes.
* src/androidterm.c (handle_one_android_event): Handle tooltip
movement correctly.
return String.valueOf (keysym);
}
- public void
- sync ()
- {
- Runnable runnable;
-
- runnable = new Runnable () {
- public void
- run ()
- {
- synchronized (this)
- {
- notify ();
- }
- }
- };
-
- syncRunnable (runnable);
- }
-
\f
/* Start the Emacs service if necessary. On Android 26 and up,
= Bitmap.createBitmap (measuredWidth,
measuredHeight,
Bitmap.Config.ARGB_8888);
- bitmap.eraseColor (0xffffffff);
+ bitmap.eraseColor (window.background | 0xff000000);
/* And canvases. */
canvas = new Canvas (bitmap);
synchronized (this)
{
/* Recycle the bitmap and call GC. */
- bitmap.recycle ();
+
+ if (bitmap != null)
+ bitmap.recycle ();
+
bitmap = null;
canvas = null;
surfaceView.setBitmap (null, null);
/* Whether or not this window is fullscreen. */
public boolean fullscreen;
+ /* The window background pixel. This is used by EmacsView when
+ creating new bitmaps. */
+ public volatile int background;
+
public
EmacsWindow (short handle, final EmacsWindow parent, int x, int y,
int width, int height, boolean overrideRedirect)
/* scratchGC is used as the argument to a FillRectangles req. */
scratchGC.foreground = pixel;
scratchGC.markDirty (false);
+
+ /* Make the background known to the view as well. */
+ background = pixel;
}
public Rect
jmethodID get_screen_height;
jmethodID detect_mouse;
jmethodID name_keysym;
- jmethodID sync;
jmethodID browse_url;
jmethodID restart_emacs;
jmethodID update_ic;
FIND_METHOD (get_screen_height, "getScreenHeight", "(Z)I");
FIND_METHOD (detect_mouse, "detectMouse", "()Z");
FIND_METHOD (name_keysym, "nameKeysym", "(I)Ljava/lang/String;");
- FIND_METHOD (sync, "sync", "()V");
FIND_METHOD (browse_url, "browseUrl", "(Ljava/lang/String;)"
"Ljava/lang/String;");
FIND_METHOD (restart_emacs, "restartEmacs", "()V");
ANDROID_DELETE_LOCAL_REF (coordinates);
}
-void
-android_sync (void)
-{
- (*android_java_env)->CallVoidMethod (android_java_env,
- emacs_service,
- service_class.sync);
- android_exception_check ();
-}
-
int
android_wc_lookup_string (android_key_pressed_event *event,
wchar_t *buffer_return, int wchars_buffer,
unsigned long mask;
block_input ();
- mask = ANDROID_CW_OVERRIDE_REDIRECT;
+ mask = ANDROID_CW_OVERRIDE_REDIRECT | ANDROID_CW_BACK_PIXEL;
attrs.override_redirect = true;
+ attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f);
tip_window
= FRAME_ANDROID_WINDOW (f)
= android_create_window (FRAME_DISPLAY_INFO (f)->root_window,
android_map_raised (FRAME_ANDROID_WINDOW (tip_f));
unblock_input ();
- /* Synchronize with the UI thread. This is required to prevent ugly
- black splotches. */
- android_sync ();
-
/* Garbage the tip frame too. */
SET_FRAME_GARBAGED (tip_f);
unbind_to (count_1, Qnil);
windows_or_buffers_changed = old_windows_or_buffers_changed;
+ /* MapNotify events are not sent on Android, so make the frame
+ visible. */
+
+ SET_FRAME_VISIBLE (tip_f, true);
+
start_timer:
/* Let the tip disappear after timeout seconds. */
tip_timer = call3 (Qrun_at_time, timeout, Qnil,
extern void android_map_raised (android_window);
extern void android_translate_coordinates (android_window, int,
int, int *, int *);
-extern void android_sync (void);
-
extern int android_wc_lookup_string (android_key_pressed_event *,
wchar_t *, int, int *,
enum android_lookup_status *);
if (!f)
goto OTHER;
+ if (FRAME_TOOLTIP_P (f))
+ {
+ if (FRAME_PIXEL_HEIGHT (f) != configureEvent.xconfigure.height
+ || FRAME_PIXEL_WIDTH (f) != configureEvent.xconfigure.width)
+ SET_FRAME_GARBAGED (f);
+
+ FRAME_PIXEL_HEIGHT (f) = configureEvent.xconfigure.height;
+ FRAME_PIXEL_WIDTH (f) = configureEvent.xconfigure.width;
+ }
+
int width = configureEvent.xconfigure.width;
int height = configureEvent.xconfigure.height;