Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
3537f849
Commit
3537f849
authored
Mar 26, 2019
by
Ahmed Ashour
Committed by
skylot
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gui): detect if a window is opened inside a visible screen (PR #521)
parent
9557f04f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
JadxSettings.java
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
+16
-2
No files found.
jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
View file @
3537f849
package
jadx
.
gui
.
settings
;
import
java.awt.*
;
import
java.awt.Font
;
import
java.awt.GraphicsDevice
;
import
java.awt.GraphicsEnvironment
;
import
java.awt.Window
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
...
...
@@ -142,14 +145,25 @@ public class JadxSettings extends JadxCLIArgs {
public
boolean
loadWindowPos
(
Window
window
)
{
WindowLocation
pos
=
windowPos
.
get
(
window
.
getClass
().
getSimpleName
());
if
(
pos
==
null
)
{
if
(
pos
==
null
||
!
isContainedInAnyScreen
(
pos
)
)
{
return
false
;
}
window
.
setLocation
(
pos
.
getX
(),
pos
.
getY
());
window
.
setSize
(
pos
.
getWidth
(),
pos
.
getHeight
());
return
true
;
}
private
static
boolean
isContainedInAnyScreen
(
WindowLocation
pos
)
{
for
(
GraphicsDevice
gd
:
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getScreenDevices
())
{
if
(
gd
.
getDefaultConfiguration
().
getBounds
().
contains
(
pos
.
getX
(),
pos
.
getY
(),
pos
.
getWidth
(),
pos
.
getHeight
()))
{
return
true
;
}
}
return
false
;
}
public
boolean
isShowHeapUsageBar
()
{
return
showHeapUsageBar
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment