Skip to content

Commit

Permalink
fix(win,linux): disable resizing maximized borderless windows (#533)
Browse files Browse the repository at this point in the history
* fix(win,linux): disable resizing maximized borderless windows

* fix change file
  • Loading branch information
amrbashir committed Mar 30, 2022
1 parent 3184d3e commit 313eaea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/disable-maximized-resize.md
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

On Windows and Linux, disable resizing maximized borderless windows.
2 changes: 1 addition & 1 deletion src/webview/webkitgtk/mod.rs
Expand Up @@ -179,7 +179,7 @@ impl InnerWebView {
if let Some(window) = widget.parent() {
// Safe to unwrap unless this is not from tao
let window: gtk::Window = window.downcast().unwrap();
if !window.is_decorated() && window.is_resizable() {
if !window.is_decorated() && window.is_resizable() && !window.is_maximized() {
if let Some(window) = window.window() {
if let Some((cx, cy)) = event.root_coords() {
if let Some(device) = event.device() {
Expand Down
2 changes: 1 addition & 1 deletion src/webview/webview2/mod.rs
Expand Up @@ -255,7 +255,7 @@ window.addEventListener('mousemove', (e) => window.chrome.webview.postMessage('_
args.TryGetWebMessageAsString(&mut js)?;
let js = take_pwstr(js);
if js == "__WEBVIEW_LEFT_MOUSE_DOWN__" || js == "__WEBVIEW_MOUSE_MOVE__" {
if !window.is_decorated() && window.is_resizable() {
if !window.is_decorated() && window.is_resizable() && !window.is_maximized() {
use crate::application::{platform::windows::hit_test, window::CursorIcon};

let mut point = POINT::default();
Expand Down

0 comments on commit 313eaea

Please sign in to comment.