Skip to content

Commit 946c3d2

Browse files
ids1024bilelmoussaoui
authored andcommitted
gdk4-x11: Make X11Display::set_program_class take &self
Despite taking `GdkDisplay`, this function casts the argument to a `GdkX11Display`.
1 parent 81519f3 commit 946c3d2

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

gdk4-x11/Gir.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ status = "generate"
131131
name = "text_property_to_text_list"
132132
# TODO: requires a manual implementation
133133
manual = true
134+
[[object.function]]
135+
name = "set_program_class"
136+
manual = true
134137

135138
[[object]]
136139
name = "GdkX11.X11Monitor"

gdk4-x11/src/auto/x11_display.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// DO NOT EDIT
44

55
use crate::X11Screen;
6-
use glib::object::IsA;
76
use glib::translate::*;
87
use std::fmt;
98
use std::mem;
@@ -229,17 +228,6 @@ impl X11Display {
229228
assert_initialized_main_thread!();
230229
unsafe { from_glib_full(ffi::gdk_x11_display_open(display_name.to_glib_none().0)) }
231230
}
232-
233-
#[doc(alias = "gdk_x11_display_set_program_class")]
234-
pub fn set_program_class(display: &impl IsA<gdk::Display>, program_class: &str) {
235-
assert_initialized_main_thread!();
236-
unsafe {
237-
ffi::gdk_x11_display_set_program_class(
238-
display.as_ref().to_glib_none().0,
239-
program_class.to_glib_none().0,
240-
);
241-
}
242-
}
243231
}
244232

245233
impl fmt::Display for X11Display {

gdk4-x11/src/x11_display.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

33
use crate::X11Display;
4+
use glib::Cast;
45
#[cfg(any(feature = "xlib", feature = "dox"))]
56
#[cfg_attr(feature = "dox", doc(cfg(feature = "xlib")))]
67
use glib::{signal::connect_raw, signal::SignalHandlerId, ObjectType};
@@ -95,4 +96,15 @@ impl X11Display {
9596
Box_::into_raw(f),
9697
)
9798
}
99+
100+
#[doc(alias = "gdk_x11_display_set_program_class")]
101+
pub fn set_program_class(&self, program_class: &str) {
102+
assert_initialized_main_thread!();
103+
unsafe {
104+
ffi::gdk_x11_display_set_program_class(
105+
self.upcast_ref::<gdk::Display>().to_glib_none().0,
106+
program_class.to_glib_none().0,
107+
);
108+
}
109+
}
98110
}

0 commit comments

Comments
 (0)