]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve criteria for restoring fullscreen state on Android
authorPo Lu <luangruo@yahoo.com>
Thu, 2 Mar 2023 04:30:36 +0000 (12:30 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 2 Mar 2023 04:30:36 +0000 (12:30 +0800)
* java/Makefile.in ($(CLASS_FILES) &): Touch all class files,
even those javac chose not to rebuild.

* java/org/gnu/emacs/EmacsActivity.java (onWindowFocusChanged):
Restore fullscreen state here.
(onResume): And not here.

java/Makefile.in
java/org/gnu/emacs/EmacsActivity.java

index 994ffdd08286fdc8b9b62fb5627355eb61774863..c7fe6e07c7783c1983de11840e561823f1d405f4 100644 (file)
@@ -261,6 +261,7 @@ $(CLASS_FILES): $(RESOURCE_FILE)
 .SUFFIXES: .java .class
 $(CLASS_FILES) &: $(JAVA_FILES)
        $(AM_V_JAVAC) $(JAVAC) $(JAVAFLAGS) $(JAVA_FILES)
+       $(AM_V_SILENT) touch $(CLASS_FILES)
 
 # N.B. that find must be called all over again in case javac generated
 # nested classes.
index c444110de60586155622a302fee51fd62acc8b7d..bcfee3f70803f06c6274b71bc833bdd9ed968b32 100644 (file)
@@ -241,6 +241,15 @@ public class EmacsActivity extends Activity
       {
        focusedActivities.add (this);
        lastFocusedActivity = this;
+
+       /* Update the window insets as the focus change may have
+          changed the window insets as well, and the system does not
+          automatically restore visibility flags.  */
+
+       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
+           && Build.VERSION.SDK_INT < Build.VERSION_CODES.R
+           && isFullscreen)
+         syncFullscreenWith (window);
       }
     else
       focusedActivities.remove (this);
@@ -264,9 +273,6 @@ public class EmacsActivity extends Activity
   {
     isPaused = false;
 
-    /* Update the window insets.  */
-    syncFullscreenWith (window);
-
     EmacsWindowAttachmentManager.MANAGER.noticeDeiconified (this);
     super.onResume ();
   }