Skip to content

Commit

Permalink
fix: Compile issue on Linux for 32bit targets (#1200)
Browse files Browse the repository at this point in the history
* fix: Compile issue on Linux for 32bit targets

* fix changelog file...
  • Loading branch information
FabianLars authored Mar 25, 2024
1 parent 3ec2ea9 commit 3e84a0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/32bit-compilation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
wry: patch
---

Fixes compilation for 32bit Linux targets.
16 changes: 11 additions & 5 deletions src/webkitgtk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ use javascriptcore::ValueExt;
use raw_window_handle::{HasWindowHandle, RawWindowHandle};
#[cfg(any(debug_assertions, feature = "devtools"))]
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use std::{
ffi::c_ulong,
sync::{Arc, Mutex},
};
#[cfg(any(debug_assertions, feature = "devtools"))]
use webkit2gtk::WebInspectorExt;
use webkit2gtk::{
Expand Down Expand Up @@ -51,7 +54,7 @@ struct X11Data {
is_child: bool,
xlib: Xlib,
x11_display: *mut std::ffi::c_void,
x11_window: u64,
x11_window: c_ulong,
gtk_window: gtk::Window,
}

Expand Down Expand Up @@ -152,9 +155,9 @@ impl InnerWebView {
fn create_container_x11_window(
xlib: &Xlib,
display: *mut _XDisplay,
parent: u64,
parent: c_ulong,
attributes: &WebViewAttributes,
) -> u64 {
) -> c_ulong {
let window = unsafe {
(xlib.XCreateSimpleWindow)(
display,
Expand All @@ -179,7 +182,10 @@ impl InnerWebView {
window
}

pub fn create_gtk_window(raw: *mut GdkX11Display, x11_window: u64) -> (gtk::Window, gtk::Box) {
pub fn create_gtk_window(
raw: *mut GdkX11Display,
x11_window: c_ulong,
) -> (gtk::Window, gtk::Box) {
// Gdk.Window
let gdk_window = unsafe { gdk_x11_window_foreign_new_for_display(raw, x11_window) };
let gdk_window = unsafe { gdk::Window::from_glib_full(gdk_window) };
Expand Down

0 comments on commit 3e84a0e

Please sign in to comment.