emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android 09aa948ab48: Improve criteria for restoring fullscreen s


From: Po Lu
Subject: feature/android 09aa948ab48: Improve criteria for restoring fullscreen state on Android
Date: Wed, 1 Mar 2023 23:30:51 -0500 (EST)

branch: feature/android
commit 09aa948ab48261b13550b76a5820d3473caf200a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Improve criteria for restoring fullscreen state on Android
    
    * 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                      |  1 +
 java/org/gnu/emacs/EmacsActivity.java | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/java/Makefile.in b/java/Makefile.in
index 994ffdd0828..c7fe6e07c77 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -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.
diff --git a/java/org/gnu/emacs/EmacsActivity.java 
b/java/org/gnu/emacs/EmacsActivity.java
index c444110de60..bcfee3f7080 100644
--- a/java/org/gnu/emacs/EmacsActivity.java
+++ b/java/org/gnu/emacs/EmacsActivity.java
@@ -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 ();
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]