gtkmm
3.97.1
|
A Gdk::Surface is a rectangular region on the screen. More...
#include <gdkmm/surface.h>
Public Member Functions | |
Surface (Surface&& src) noexcept | |
Surface& | operator= (Surface&& src) noexcept |
~Surface () noexcept override | |
GdkSurface* | gobj () |
Provides access to the underlying C GObject. More... | |
const GdkSurface* | gobj () const |
Provides access to the underlying C GObject. More... | |
GdkSurface* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Type | get_surface_type () const |
Gets the type of the surface. More... | |
Glib::RefPtr< Surface > | get_parent () |
Returns the parent surface of a surface, or nullptr if the surface does not have a parent. More... | |
Glib::RefPtr< const Surface > | get_parent () const |
Returns the parent surface of a surface, or nullptr if the surface does not have a parent. More... | |
Glib::RefPtr< Display > | get_display () |
Gets the Gdk::Display associated with a Gdk::Surface. More... | |
Glib::RefPtr< const Display > | get_display () const |
Gets the Gdk::Display associated with a Gdk::Surface. More... | |
void | show () |
Like show_unraised(), but also raises the surface to the top of the surface stack (moves the surface to the front of the Z-order). More... | |
void | hide () |
For toplevel surfaces, withdraws them, so they will no longer be known to the window manager; for all surfaces, unmaps them, so they won’t be displayed. More... | |
void | show_unraised () |
Shows a Gdk::Surface onscreen, but does not modify its stacking order. More... | |
void | resize (int width, int height) |
Resizes surface; for toplevel surfaces, asks the window manager to resize the surface. More... | |
void | move_to_rect (const Rectangle& rect, Gravity rect_anchor, Gravity surface_anchor, AnchorHints anchor_hints, int rect_anchor_dx, int rect_anchor_dy) |
Moves surface to rect, aligning their anchor points. More... | |
void | raise () |
Raises surface to the top of the Z-order (stacking order), so that other surfaces with the same parent surface appear below surface. More... | |
void | lower () |
Lowers surface to the bottom of the Z-order (stacking order), so that other surfaces with the same parent surface appear above surface. More... | |
void | restack (const Glib::RefPtr< Surface >& sibling, bool above) |
Changes the position of surface in the Z-order (stacking order), so that it is above sibling (if above is true ) or below sibling (if above is false ). More... | |
void | restack (bool above) |
Changes the position of this surface in the Z-order (stacking order). More... | |
void | focus (guint32 timestamp) |
Sets keyboard focus to surface. More... | |
void | input_shape_combine_region (const ::Cairo::RefPtr< ::Cairo::Region >& shape_region, int offset_x, int offset_y) |
Apply the region to the surface for the purpose of event handling. More... | |
bool | is_visible () const |
Checks whether the surface has been mapped (with show() or show_unraised()). More... | |
bool | is_viewable () const |
Check if the surface and all ancestors of the surface are mapped. More... | |
State | get_state () const |
Gets the bitwise OR of the currently active surface state flags, from the Gdk::Surface::State enumeration. More... | |
void | set_type_hint (TypeHint hint) |
The application can use this call to provide a hint to the surface manager about the functionality of a surface. More... | |
TypeHint | get_type_hint () |
This function returns the type hint set for a surface. More... | |
bool | get_modal_hint () const |
Determines whether or not the window manager is hinted that surface has modal behaviour. More... | |
void | set_modal_hint (bool modal=true) |
The application can use this hint to tell the window manager that a certain surface has modal behaviour. More... | |
void | set_geometry_hints (const Geometry& geometry, Hints geom_mask) |
Sets the geometry hints for surface. More... | |
void | set_title (const Glib::ustring& title) |
Sets the title of a toplevel surface, to be displayed in the titlebar. More... | |
void | set_startup_id (const Glib::ustring& startup_id) |
When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function. More... | |
void | set_transient_for (const Glib::RefPtr< Surface >& parent) |
Indicates to the window manager that surface is a transient dialog associated with the application surface parent. More... | |
void | set_cursor (const Glib::RefPtr< Cursor >& cursor) |
Sets the default mouse pointer for a Gdk::Surface. More... | |
void | set_cursor () |
Use the parent surface's cursor. More... | |
void | set_device_cursor (const Glib::RefPtr< Device >& device, const Glib::RefPtr< Cursor >& cursor) |
Sets a specific Gdk::Cursor for a given device when it gets inside surface. More... | |
Glib::RefPtr< Cursor > | get_device_cursor (const Glib::RefPtr< Device >& device) |
Retrieves a Gdk::Cursor pointer for the device currently set on the specified Gdk::Surface, or nullptr . More... | |
Glib::RefPtr< const Cursor > | get_device_cursor (const Glib::RefPtr< const Device >& device) const |
Retrieves a Gdk::Cursor pointer for the device currently set on the specified Gdk::Surface, or nullptr . More... | |
Glib::RefPtr< Cursor > | get_cursor () |
Retrieves a Gdk::Cursor pointer for the cursor currently set on the specified Gdk::Surface, or nullptr . More... | |
Glib::RefPtr< const Cursor > | get_cursor () const |
Retrieves a Gdk::Cursor pointer for the cursor currently set on the specified Gdk::Surface, or nullptr . More... | |
int | get_width () const |
Returns the width of the given surface. More... | |
int | get_height () const |
Returns the height of the given surface. More... | |
void | get_position (int& x, int& y) const |
Obtains the position of the surface relative to its parent. More... | |
int | get_scale_factor () const |
Returns the internal scale factor that maps from surface coordiantes to the actual device pixels. More... | |
void | get_device_position (const Glib::RefPtr< const Device >& device, double& x, double& y, ModifierType& mask) const |
Obtains the current device position in doubles and modifier state. More... | |
void | set_icon_list (const std::vector< Glib::RefPtr< Texture >>& textures) |
Sets a list of icons for the surface. More... | |
void | unset_icon () |
void | set_icon_name (const Glib::ustring& name) |
Surfaces may have a name used while minimized, distinct from the name they display in their titlebar. More... | |
void | set_decorations (WMDecoration decorations) |
“Decorations” are the features the window manager adds to a toplevel Gdk::Surface. More... | |
bool | get_decorations (WMDecoration& decorations) const |
Returns the decorations set on the GdkSurface with set_decorations(). More... | |
void | set_functions (WMFunction functions) |
Sets hints about the window management functions to make available via buttons on the window frame. More... | |
::Cairo::RefPtr< ::Cairo::Surface > | create_similar_surface (::Cairo::Content content, int width, int height) |
Create a new surface that is as compatible as possible with the given surface. More... | |
void | beep () |
Emits a short beep associated to surface in the appropriate display, if supported. More... | |
void | minimize () |
Asks to minimize the surface. More... | |
void | unminimize () |
Asks to unminimize the surface. More... | |
void | stick () |
“Pins” a surface such that it’s on all workspaces and does not scroll with viewports, for window managers that have scrollable viewports. More... | |
void | unstick () |
Reverse operation for stick(); see stick(), and gtk_window_unstick(). More... | |
void | maximize () |
Maximizes the surface. More... | |
void | unmaximize () |
Unmaximizes the surface. More... | |
void | register_dnd () |
Registers a surface as a potential drop destination. More... | |
void | begin_resize_drag (SurfaceEdge edge, int button, int root_x, int root_y, guint32 timestamp) |
Begins a surface resize operation (for a toplevel surface). More... | |
void | resize_drag (SurfaceEdge edge, const Glib::RefPtr< Device >& device, int button, int root_x, int root_y, guint32 timestamp) |
Begins a surface resize operation (for a toplevel surface). More... | |
void | begin_move_drag (int button, int root_x, int root_y, guint32 timestamp) |
Begins a surface move operation (for a toplevel surface). More... | |
void | begin_move_drag (const Glib::RefPtr< Device >& device, int button, int root_x, int root_y, guint32 timestamp) |
Begins a surface move operation (for a toplevel surface). More... | |
Glib::RefPtr< Drag > | drag_begin_from_point (const Glib::RefPtr< Device >& device, const Glib::RefPtr< ContentProvider >& content, DragAction actions, int dx, int dy) |
Starts a drag and creates a new drag context for it. More... | |
void | queue_expose () |
Forces an expose event for surface to be scheduled. More... | |
void | freeze_updates () |
Temporarily freezes a surface such that it won’t receive expose events. More... | |
void | thaw_updates () |
Thaws a surface frozen with freeze_updates(). More... | |
void | fullscreen () |
Moves the surface into fullscreen mode. More... | |
void | fullscreen_on_monitor (const Glib::RefPtr< Monitor >& monitor) |
Moves the surface into fullscreen mode on the given monitor. More... | |
void | set_fullscreen_mode (FullscreenMode mode) |
Specifies whether the surface should span over all monitors (in a multi-head setup) or only the current monitor when in fullscreen mode. More... | |
FullscreenMode | get_fullscreen_mode () const |
Obtains the Gdk::FullscreenMode of the surface. More... | |
void | unfullscreen () |
Moves the surface out of fullscreen mode. More... | |
void | set_keep_above (bool setting=true) |
Set if surface must be kept above other surfaces. More... | |
void | set_keep_below (bool setting=true) |
Set if surface must be kept below other surfaces. More... | |
void | set_opacity (double opacity) |
Set surface to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque. More... | |
bool | get_accept_focus () const |
Determines whether or not the desktop environment shuld be hinted that the surface does not want to receive input focus. More... | |
void | set_accept_focus (bool accept_focus=true) |
Setting accept_focus to false hints the desktop environment that the surface doesn’t want to receive input focus. More... | |
bool | get_focus_on_map () const |
Determines whether or not the desktop environment should be hinted that the surface does not want to receive input focus when it is mapped. More... | |
void | set_focus_on_map (bool focus_on_map) |
Setting focus_on_map to false hints the desktop environment that the surface doesn’t want to receive input focus when it is mapped. More... | |
void | set_support_multidevice (bool support_multidevice=true) |
This function will enable multidevice features in surface. More... | |
bool | get_support_multidevice () |
Returns true if the surface is aware of the existence of multiple devices. More... | |
Glib::RefPtr< FrameClock > | get_frame_clock () |
Gets the frame clock for the surface. More... | |
Glib::RefPtr< const FrameClock > | get_frame_clock () const |
Gets the frame clock for the surface. More... | |
void | set_opaque_region (const ::Cairo::RefPtr< const ::Cairo::Region >& region) |
For optimisation purposes, compositing window managers may like to not draw obscured regions of surfaces, or turn off blending during for these regions. More... | |
void | set_shadow_width (int left, int right, int top, int bottom) |
Newer GTK windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders. More... | |
bool | show_window_menu (const Glib::RefPtr< const Event >& event) |
Asks the windowing system to show the window menu. More... | |
Glib::RefPtr< Gdk::GLContext > | create_gl_context () |
Creates a new GLContext matching the framebuffer format to the visual of the Surface. More... | |
Glib::RefPtr< Gdk::CairoContext > | create_cairo_context () |
Creates a new Gdk::CairoContext for rendering on surface. More... | |
Glib::SignalProxy< void(const Gdk::Rectangle&, const Gdk::Rectangle&, bool, bool)> | signal_moved_to_rect () |
Glib::SignalProxy< void(int, int)> | signal_size_changed () |
Glib::SignalProxy< bool(const ::Cairo::RefPtr< const ::Cairo::Region >&)> | signal_render () |
Glib::SignalProxy< bool(const Glib::RefPtr< const Event >&)> | signal_event () |
Glib::PropertyProxy< Glib::RefPtr< Cursor > > | property_cursor () |
The mouse pointer for a Gdk::Surface. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Cursor > > | property_cursor () const |
The mouse pointer for a Gdk::Surface. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > | property_display () const |
The Gdk::Display connection of the surface. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Surface > > | property_parent () const |
Parent surface. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< FrameClock > > | property_frame_clock () const |
Frame Clock. More... | |
Glib::PropertyProxy_ReadOnly< State > | property_state () const |
State. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_mapped () const |
Mapped. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_autohide () const |
Whether to dismiss the surface on outside clicks. More... | |
Glib::PropertyProxy_ReadOnly< Type > | property_surface_type () const |
Surface type. More... | |
![]() | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
PropertyType | get_property (const Glib::ustring &property_name) const |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< Surface > | create_toplevel (const Glib::RefPtr< Display >& display, int width, int height) |
Creates a new toplevel surface. More... | |
static Glib::RefPtr< Surface > | create_temp (const Glib::RefPtr< Display >& display, const Rectangle& position) |
Creates a new temporary surface. More... | |
static Glib::RefPtr< Surface > | create_popup (const Glib::RefPtr< Display >& display, const Glib::RefPtr< Surface >& parent, bool autohide) |
Create a new popup surface. More... | |
static void | constrain_size (const Geometry& geometry, Hints flags, int width, int height, int& new_width, int& new_height) |
Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size). More... | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gdk::Surface > | wrap (GdkSurface* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
A Gdk::Surface is a rectangular region on the screen.
It's a low-level object, used to implement high-level objects such as Gtk::Widget and Gtk::Window on the GTK+ level. A Gtk::Window is a toplevel window, the thing a user might think of as a "window" with a titlebar and so on; a Gtk::Window may contain many Gdk::Surfaces. For example, each Gtk::Button has a Gdk::Surface associated with it.
|
noexcept |
|
overridenoexcept |
void Gdk::Surface::beep | ( | ) |
Emits a short beep associated to surface in the appropriate display, if supported.
Otherwise, emits a short beep on the display just as Gdk::Display::beep().
void Gdk::Surface::begin_move_drag | ( | int | button, |
int | root_x, | ||
int | root_y, | ||
guint32 | timestamp | ||
) |
Begins a surface move operation (for a toplevel surface).
This function assumes that the drag is controlled by the client pointer device, use begin_move_drag_for_device() to begin a drag with a different device.
void Gdk::Surface::begin_move_drag | ( | const Glib::RefPtr< Device >& | device, |
int | button, | ||
int | root_x, | ||
int | root_y, | ||
guint32 | timestamp | ||
) |
Begins a surface move operation (for a toplevel surface).
device | The device used for the operation. |
button | The button being used to drag, or 0 for a keyboard-initiated drag. |
root_x | Surface X coordinate of mouse click that began the drag. |
root_y | Surface Y coordinate of mouse click that began the drag. |
timestamp | Timestamp of mouse click that began the drag. |
void Gdk::Surface::begin_resize_drag | ( | SurfaceEdge | edge, |
int | button, | ||
int | root_x, | ||
int | root_y, | ||
guint32 | timestamp | ||
) |
Begins a surface resize operation (for a toplevel surface).
This function assumes that the drag is controlled by the client pointer device, use begin_resize_drag_for_device() to begin a drag with a different device.
edge | The edge or corner from which the drag is started. |
button | The button being used to drag, or 0 for a keyboard-initiated drag. |
root_x | Surface X coordinate of mouse click that began the drag. |
root_y | Surface Y coordinate of mouse click that began the drag. |
timestamp | Timestamp of mouse click that began the drag (use Gdk::Event::get_time()). |
|
static |
Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).
geometry | A Gdk::Geometry structure. |
flags | A mask indicating what portions of geometry are set. |
width | Desired width of surface. |
height | Desired height of the surface. |
new_width | Location to store resulting width. |
new_height | Location to store resulting height. |
Glib::RefPtr<Gdk::CairoContext> Gdk::Surface::create_cairo_context | ( | ) |
Creates a new Gdk::CairoContext for rendering on surface.
Glib::RefPtr<Gdk::GLContext> Gdk::Surface::create_gl_context | ( | ) |
Creates a new GLContext matching the framebuffer format to the visual of the Surface.
The context is disconnected from any particular surface.
If the creation of the GLContext failed an error will be thrown.
Before using the returned GLContext, you will need to call GLContext::make_current() or GLContext::realize().
GLError | On missing GL implementation or extension required for context creation. |
|
static |
Create a new popup surface.
The surface will be attached to parent and can be positioned relative to it using move_to_rect().
display | The display to create the surface on. |
parent | The parent surface to attach the surface to. |
autohide | Whether to hide the surface on outside clicks. |
::Cairo::RefPtr< ::Cairo::Surface> Gdk::Surface::create_similar_surface | ( | ::Cairo::Content | content, |
int | width, | ||
int | height | ||
) |
Create a new surface that is as compatible as possible with the given surface.
For example the new surface will have the same fallback resolution and font options as surface. Generally, the new surface will also use the same backend as surface, unless that is not possible for some reason. The type of the returned surface may be examined with cairo_surface_get_type().
Initially the surface contents are all 0 (transparent if contents have transparency, black otherwise.)
content | The content for the new surface. |
width | Width of the new surface. |
height | Height of the new surface. |
This function always returns a valid pointer, but it will return a pointer to a “nil” surface if other is already in an error state or any other error occurs.
|
static |
Creates a new temporary surface.
The surface will bypass surface management.
display | The display to create the surface on. |
position | Position of the surface on screen. |
|
static |
Creates a new toplevel surface.
display | The display to create the surface on. |
width | Width of new surface. |
height | Height of new surface. |
Glib::RefPtr<Drag> Gdk::Surface::drag_begin_from_point | ( | const Glib::RefPtr< Device >& | device, |
const Glib::RefPtr< ContentProvider >& | content, | ||
DragAction | actions, | ||
int | dx, | ||
int | dy | ||
) |
Starts a drag and creates a new drag context for it.
This function is called by the drag source. After this call, you probably want to set up the drag icon using the surface returned by get_drag_surface().
device | The device that controls this drag. |
content | The offered content. |
actions | The actions supported by this drag. |
dx | The x offset to device's position where the drag nominally started. |
dy | The y offset to device's position where the drag nominally started. |
nullptr
on error. void Gdk::Surface::focus | ( | guint32 | timestamp | ) |
Sets keyboard focus to surface.
In most cases, gtk_window_present_with_time() should be used on a Gtk::Window, rather than calling this function.
timestamp | Timestamp of the event triggering the surface focus. |
void Gdk::Surface::freeze_updates | ( | ) |
Temporarily freezes a surface such that it won’t receive expose events.
The surface will begin receiving expose events again when thaw_updates() is called. If freeze_updates() has been called more than once, thaw_updates() must be called an equal number of times to begin processing exposes.
void Gdk::Surface::fullscreen | ( | ) |
Moves the surface into fullscreen mode.
This means the surface covers the entire screen and is above any panels or task bars.
If the surface was already fullscreen, then this function does nothing.
On X11, asks the window manager to put surface in a fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the fullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
void Gdk::Surface::fullscreen_on_monitor | ( | const Glib::RefPtr< Monitor >& | monitor | ) |
Moves the surface into fullscreen mode on the given monitor.
This means the surface covers the entire screen and is above any panels or task bars.
If the surface was already fullscreen, then this function does nothing.
monitor | Which monitor to display fullscreen on. |
bool Gdk::Surface::get_accept_focus | ( | ) | const |
Determines whether or not the desktop environment shuld be hinted that the surface does not want to receive input focus.
Glib::RefPtr<Cursor> Gdk::Surface::get_cursor | ( | ) |
Retrieves a Gdk::Cursor pointer for the cursor currently set on the specified Gdk::Surface, or nullptr
.
If the return value is nullptr
then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.
nullptr
. The returned object is owned by the Gdk::Surface and should not be unreferenced directly. Use set_cursor() to unset the cursor of the surface. Glib::RefPtr<const Cursor> Gdk::Surface::get_cursor | ( | ) | const |
Retrieves a Gdk::Cursor pointer for the cursor currently set on the specified Gdk::Surface, or nullptr
.
If the return value is nullptr
then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.
nullptr
. The returned object is owned by the Gdk::Surface and should not be unreferenced directly. Use set_cursor() to unset the cursor of the surface. bool Gdk::Surface::get_decorations | ( | WMDecoration& | decorations | ) | const |
Returns the decorations set on the GdkSurface with set_decorations().
decorations | The surface decorations will be written here. |
true
if the surface has decorations set, false
otherwise. Glib::RefPtr<Cursor> Gdk::Surface::get_device_cursor | ( | const Glib::RefPtr< Device >& | device | ) |
Retrieves a Gdk::Cursor pointer for the device currently set on the specified Gdk::Surface, or nullptr
.
If the return value is nullptr
then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.
device | A master, pointer Gdk::Device. |
nullptr
. The returned object is owned by the Gdk::Surface and should not be unreferenced directly. Use set_cursor() to unset the cursor of the surface. Glib::RefPtr<const Cursor> Gdk::Surface::get_device_cursor | ( | const Glib::RefPtr< const Device >& | device | ) | const |
Retrieves a Gdk::Cursor pointer for the device currently set on the specified Gdk::Surface, or nullptr
.
If the return value is nullptr
then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.
device | A master, pointer Gdk::Device. |
nullptr
. The returned object is owned by the Gdk::Surface and should not be unreferenced directly. Use set_cursor() to unset the cursor of the surface. void Gdk::Surface::get_device_position | ( | const Glib::RefPtr< const Device >& | device, |
double & | x, | ||
double & | y, | ||
ModifierType& | mask | ||
) | const |
Obtains the current device position in doubles and modifier state.
The position is given in coordinates relative to the upper left corner of surface.
device | Pointer Gdk::Device to query to. |
x | Return location for the X coordinate of device, or nullptr . |
y | Return location for the Y coordinate of device, or nullptr . |
mask | Return location for the modifier mask, or nullptr . |
Glib::RefPtr<Display> Gdk::Surface::get_display | ( | ) |
Gets the Gdk::Display associated with a Gdk::Surface.
Glib::RefPtr<const Display> Gdk::Surface::get_display | ( | ) | const |
Gets the Gdk::Display associated with a Gdk::Surface.
bool Gdk::Surface::get_focus_on_map | ( | ) | const |
Determines whether or not the desktop environment should be hinted that the surface does not want to receive input focus when it is mapped.
Glib::RefPtr<FrameClock> Gdk::Surface::get_frame_clock | ( | ) |
Gets the frame clock for the surface.
The frame clock for a surface never changes unless the surface is reparented to a new toplevel surface.
Glib::RefPtr<const FrameClock> Gdk::Surface::get_frame_clock | ( | ) | const |
Gets the frame clock for the surface.
The frame clock for a surface never changes unless the surface is reparented to a new toplevel surface.
FullscreenMode Gdk::Surface::get_fullscreen_mode | ( | ) | const |
Obtains the Gdk::FullscreenMode of the surface.
int Gdk::Surface::get_height | ( | ) | const |
Returns the height of the given surface.
On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.
bool Gdk::Surface::get_modal_hint | ( | ) | const |
Determines whether or not the window manager is hinted that surface has modal behaviour.
Glib::RefPtr<Surface> Gdk::Surface::get_parent | ( | ) |
Returns the parent surface of a surface, or nullptr
if the surface does not have a parent.
Only popup surfaces have parents.
nullptr
. Glib::RefPtr<const Surface> Gdk::Surface::get_parent | ( | ) | const |
Returns the parent surface of a surface, or nullptr
if the surface does not have a parent.
Only popup surfaces have parents.
nullptr
. void Gdk::Surface::get_position | ( | int & | x, |
int & | y | ||
) | const |
Obtains the position of the surface relative to its parent.
x | X coordinate of surface. |
y | Y coordinate of surface. |
int Gdk::Surface::get_scale_factor | ( | ) | const |
Returns the internal scale factor that maps from surface coordiantes to the actual device pixels.
On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).
A higher value means that drawing is automatically scaled up to a higher resolution, so any code doing drawing will automatically look nicer. However, if you are supplying pixel-based data the scale value can be used to determine whether to use a pixel resource with higher resolution data.
The scale of a surface may change during runtime, if this happens a configure event will be sent to the toplevel surface.
State Gdk::Surface::get_state | ( | ) | const |
Gets the bitwise OR of the currently active surface state flags, from the Gdk::Surface::State enumeration.
bool Gdk::Surface::get_support_multidevice | ( | ) |
Returns true
if the surface is aware of the existence of multiple devices.
true
if the surface handles multidevice features. Type Gdk::Surface::get_surface_type | ( | ) | const |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
TypeHint Gdk::Surface::get_type_hint | ( | ) |
This function returns the type hint set for a surface.
int Gdk::Surface::get_width | ( | ) | const |
Returns the width of the given surface.
On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GdkSurface* Gdk::Surface::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void Gdk::Surface::hide | ( | ) |
For toplevel surfaces, withdraws them, so they will no longer be known to the window manager; for all surfaces, unmaps them, so they won’t be displayed.
Normally done automatically as part of gtk_widget_hide().
void Gdk::Surface::input_shape_combine_region | ( | const ::Cairo::RefPtr< ::Cairo::Region > & | shape_region, |
int | offset_x, | ||
int | offset_y | ||
) |
Apply the region to the surface for the purpose of event handling.
Mouse events which happen while the pointer position corresponds to an unset bit in the mask will be passed on the surface below surface.
An input shape is typically used with RGBA surfaces. The alpha channel of the surface defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the surface is “clickable”.
On the X11 platform, this requires version 1.1 of the shape extension.
On the Win32 platform, this functionality is not present and the function does nothing.
shape_region | Region of surface to be non-transparent. |
offset_x | X position of shape_region in surface coordinates. |
offset_y | Y position of shape_region in surface coordinates. |
bool Gdk::Surface::is_viewable | ( | ) | const |
Check if the surface and all ancestors of the surface are mapped.
(This is not necessarily "viewable" in the X sense, since we only check as far as we have GDK surface parents, not to the root surface.)
true
if the surface is viewable. bool Gdk::Surface::is_visible | ( | ) | const |
Checks whether the surface has been mapped (with show() or show_unraised()).
true
if the surface is mapped. void Gdk::Surface::lower | ( | ) |
Lowers surface to the bottom of the Z-order (stacking order), so that other surfaces with the same parent surface appear above surface.
This is true whether or not the other surfaces are visible.
If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, lower() only requests the restack, does not guarantee it.
Note that show() raises the surface again, so don’t call this function before show(). (Try show_unraised().)
void Gdk::Surface::maximize | ( | ) |
Maximizes the surface.
If the surface was already maximized, then this function does nothing.
On X11, asks the window manager to maximize surface, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the maximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
On Windows, reliably maximizes the surface.
void Gdk::Surface::minimize | ( | ) |
Asks to minimize the surface.
The windowing system may choose to ignore the request.
You can track the result of this request by using the Gdk::Surface::property_state() property.
This function only makes sense when surface is a toplevel surface.
void Gdk::Surface::move_to_rect | ( | const Rectangle& | rect, |
Gravity | rect_anchor, | ||
Gravity | surface_anchor, | ||
AnchorHints | anchor_hints, | ||
int | rect_anchor_dx, | ||
int | rect_anchor_dy | ||
) |
Moves surface to rect, aligning their anchor points.
rect is relative to the top-left corner of the surface that surface is transient for. rect_anchor and surface_anchor determine anchor points on rect and surface to pin together. rect's anchor point can optionally be offset by rect_anchor_dx and rect_anchor_dy, which is equivalent to offsetting the position of surface.
anchor_hints determines how surface will be moved if the anchor points cause it to move off-screen. For example, Gdk::AnchorHints::FLIP_X will replace Gdk::Gravity::NORTH_WEST with Gdk::Gravity::NORTH_EAST and vice versa if surface extends beyond the left or right edges of the monitor.
Connect to the Gdk::Surface::signal_moved_to_rect() signal to find out how it was actually positioned.
rect | The destination Gdk::Rectangle to align surface with. |
rect_anchor | The point on rect to align with surface's anchor point. |
surface_anchor | The point on surface to align with rect's anchor point. |
anchor_hints | Positioning hints to use when limited on space. |
rect_anchor_dx | Horizontal offset to shift surface, i.e. rect's anchor point. |
rect_anchor_dy | Vertical offset to shift surface, i.e. rect's anchor point. |
Glib::PropertyProxy_ReadOnly< bool > Gdk::Surface::property_autohide | ( | ) | const |
Whether to dismiss the surface on outside clicks.
Default value: false
Glib::PropertyProxy< Glib::RefPtr<Cursor> > Gdk::Surface::property_cursor | ( | ) |
The mouse pointer for a Gdk::Surface.
See Gdk::Surface::set_cursor() and Gdk::Surface::get_cursor() for details.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Cursor> > Gdk::Surface::property_cursor | ( | ) | const |
The mouse pointer for a Gdk::Surface.
See Gdk::Surface::set_cursor() and Gdk::Surface::get_cursor() for details.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> > Gdk::Surface::property_display | ( | ) | const |
The Gdk::Display connection of the surface.
See Gdk::Surface::get_display() for details.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<FrameClock> > Gdk::Surface::property_frame_clock | ( | ) | const |
Frame Clock.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Surface::property_mapped | ( | ) | const |
Mapped.
Default value: false
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Surface> > Gdk::Surface::property_parent | ( | ) | const |
Parent surface.
Glib::PropertyProxy_ReadOnly< State > Gdk::Surface::property_state | ( | ) | const |
State.
Default value: Gdk::Surface::State::WITHDRAWN
Glib::PropertyProxy_ReadOnly< Type > Gdk::Surface::property_surface_type | ( | ) | const |
Surface type.
Default value: Gdk::Surface::Type::TOPLEVEL
void Gdk::Surface::queue_expose | ( | ) |
Forces an expose event for surface to be scheduled.
If the invalid area of surface is empty, an expose event will still be emitted. Its invalid region will be empty.
This function is useful for implementations that track invalid regions on their own.
void Gdk::Surface::raise | ( | ) |
Raises surface to the top of the Z-order (stacking order), so that other surfaces with the same parent surface appear below surface.
This is true whether or not the surfaces are visible.
If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, raise() only requests the restack, does not guarantee it.
void Gdk::Surface::register_dnd | ( | ) |
Registers a surface as a potential drop destination.
void Gdk::Surface::resize | ( | int | width, |
int | height | ||
) |
Resizes surface; for toplevel surfaces, asks the window manager to resize the surface.
The window manager may not allow the resize. When using GTK, use gtk_window_resize() instead of this low-level GDK function.
Surfaces may not be resized below 1x1.
width | New width of the surface. |
height | New height of the surface. |
void Gdk::Surface::resize_drag | ( | SurfaceEdge | edge, |
const Glib::RefPtr< Device >& | device, | ||
int | button, | ||
int | root_x, | ||
int | root_y, | ||
guint32 | timestamp | ||
) |
Begins a surface resize operation (for a toplevel surface).
You might use this function to implement a “window resize grip,”
edge | The edge or corner from which the drag is started. |
device | The device used for the operation. |
button | The button being used to drag, or 0 for a keyboard-initiated drag. |
root_x | Surface X coordinate of mouse click that began the drag. |
root_y | Surface Y coordinate of mouse click that began the drag. |
timestamp | Timestamp of mouse click that began the drag (use Gdk::Event::get_time()). |
void Gdk::Surface::restack | ( | const Glib::RefPtr< Surface >& | sibling, |
bool | above | ||
) |
Changes the position of surface in the Z-order (stacking order), so that it is above sibling (if above is true
) or below sibling (if above is false
).
If sibling is nullptr
, then this either raises (if above is true
) or lowers the surface.
If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, restack() only requests the restack, does not guarantee it.
sibling | A Gdk::Surface that is a sibling of surface, or nullptr . |
above | A boolean. |
void Gdk::Surface::restack | ( | bool | above | ) |
Changes the position of this surface in the Z-order (stacking order).
This either raises (if above is true) or lowers the surface.
If this is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order. restack() only requests the restack but does not guarantee it.
above | Whether to raise or lower the surface. |
void Gdk::Surface::set_accept_focus | ( | bool | accept_focus = true | ) |
Setting accept_focus to false
hints the desktop environment that the surface doesn’t want to receive input focus.
On X, it is the responsibility of the window manager to interpret this hint. ICCCM-compliant window manager usually respect it.
accept_focus | true if the surface should receive input focus. |
void Gdk::Surface::set_cursor | ( | const Glib::RefPtr< Cursor >& | cursor | ) |
Sets the default mouse pointer for a Gdk::Surface.
Note that cursor must be for the same display as surface.
Use Gdk::Cursor::new_from_name() or Gdk::Cursor::new_from_texture() to create the cursor. To make the cursor invisible, use Gdk::Cursor::Type::BLANK_CURSOR. Passing nullptr
for the cursor argument to set_cursor() means that surface will use the cursor of its parent surface. Most surfaces should use this default.
cursor | A cursor. |
void Gdk::Surface::set_cursor | ( | ) |
Use the parent surface's cursor.
For top-level windows this means that it will use the default cursor for the ROOT window.
void Gdk::Surface::set_decorations | ( | WMDecoration | decorations | ) |
“Decorations” are the features the window manager adds to a toplevel Gdk::Surface.
This function sets the traditional Motif window manager hints that tell the window manager which decorations you would like your surface to have. Usually you should use gtk_window_set_decorated() on a Gtk::Window instead of using the GDK function directly.
The decorations argument is the logical OR of the fields in the Gdk::WMDecoration enumeration. If Gdk::WMDecoration::ALL is included in the mask, the other bits indicate which decorations should be turned off. If Gdk::WMDecoration::ALL is not included, then the other bits indicate which decorations should be turned on.
Most window managers honor a decorations hint of 0 to disable all decorations, but very few honor all possible combinations of bits.
decorations | Decoration hint mask. |
void Gdk::Surface::set_device_cursor | ( | const Glib::RefPtr< Device >& | device, |
const Glib::RefPtr< Cursor >& | cursor | ||
) |
Sets a specific Gdk::Cursor for a given device when it gets inside surface.
Use gdk_cursor_new_fromm_name() or Gdk::Cursor::new_from_texture() to create the cursor. To make the cursor invisible, use Gdk::Cursor::Type::BLANK_CURSOR. Passing nullptr
for the cursor argument to set_cursor() means that surface will use the cursor of its parent surface. Most surfaces should use this default.
device | A master, pointer Gdk::Device. |
cursor | A Gdk::Cursor. |
void Gdk::Surface::set_focus_on_map | ( | bool | focus_on_map | ) |
Setting focus_on_map to false
hints the desktop environment that the surface doesn’t want to receive input focus when it is mapped.
focus_on_map should be turned off for surfaces that aren’t triggered interactively (such as popups from network activity).
On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it.
focus_on_map | true if the surface should receive input focus when mapped. |
void Gdk::Surface::set_fullscreen_mode | ( | FullscreenMode | mode | ) |
Specifies whether the surface should span over all monitors (in a multi-head setup) or only the current monitor when in fullscreen mode.
The mode argument is from the Gdk::FullscreenMode enumeration. If Gdk::FullscreenMode::ON_ALL_MONITORS is specified, the fullscreen surface will span over all monitors of the display.
On X11, searches through the list of monitors display the ones which delimit the 4 edges of the entire display and will ask the window manager to span the surface over these monitors.
If the XINERAMA extension is not available or not usable, this function has no effect.
Not all window managers support this, so you can’t rely on the fullscreen surface to span over the multiple monitors when Gdk::FullscreenMode::ON_ALL_MONITORS is specified.
mode | Fullscreen mode. |
void Gdk::Surface::set_functions | ( | WMFunction | functions | ) |
Sets hints about the window management functions to make available via buttons on the window frame.
On the X backend, this function sets the traditional Motif window manager hint for this purpose. However, few window managers do anything reliable or interesting with this hint. Many ignore it entirely.
The functions argument is the logical OR of values from the Gdk::WMFunction enumeration. If the bitmask includes Gdk::WMFunction::ALL, then the other bits indicate which functions to disable; if it doesn’t include Gdk::WMFunction::ALL, it indicates which functions to enable.
functions | Bitmask of operations to allow on surface. |
Sets the geometry hints for surface.
Hints flagged in geom_mask are set, hints not flagged in geom_mask are unset. To unset all hints, use a geom_mask of 0 and a geometry of nullptr
.
This function provides hints to the surfaceing system about acceptable sizes for a toplevel surface. The purpose of this is to constrain user resizing, but the windowing system will typically (but is not required to) also constrain the current size of the surface to the provided values and constrain programatic resizing via resize().
Note that on X11, this effect has no effect on surfaces of type Gdk::Surface::Type::TEMP since these surfaces are not resizable by the user.
Since you can’t count on the windowing system doing the constraints for programmatic resizes, you should generally call constrain_size() yourself to determine appropriate sizes.
geometry | Geometry hints. |
geom_mask | Bitmask indicating fields of geometry to pay attention to. |
void Gdk::Surface::set_icon_list | ( | const std::vector< Glib::RefPtr< Texture >>& | textures | ) |
Sets a list of icons for the surface.
One of these will be used to represent the surface when it has been iconified. The icon is usually shown in an icon box or some sort of task bar. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality since the window manager may only need to scale the icon by a small amount or not at all.
Note that some platforms don't support surface icons.
textures | A list of image surfaces, of different sizes. |
void Gdk::Surface::set_icon_name | ( | const Glib::ustring & | name | ) |
Surfaces may have a name used while minimized, distinct from the name they display in their titlebar.
Most of the time this is a bad idea from a user interface standpoint. But you can set such a name with this function, if you like.
After calling this with a non-nullptr
name, calls to set_title() will not update the icon title.
Using nullptr
for name unsets the icon title; further calls to set_title() will again update the icon title as well.
Note that some platforms don't support surface icons.
name | Name of surface while iconified (minimized). |
void Gdk::Surface::set_keep_above | ( | bool | setting = true | ) |
Set if surface must be kept above other surfaces.
If the surface was already above, then this function does nothing.
On X11, asks the window manager to keep surface above, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep above”; so you can’t rely on the surface being kept above. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
setting | Whether to keep surface above other surfaces. |
void Gdk::Surface::set_keep_below | ( | bool | setting = true | ) |
Set if surface must be kept below other surfaces.
If the surface was already below, then this function does nothing.
On X11, asks the window manager to keep surface below, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep below”; so you can’t rely on the surface being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
setting | Whether to keep surface below other surfaces. |
void Gdk::Surface::set_modal_hint | ( | bool | modal = true | ) |
The application can use this hint to tell the window manager that a certain surface has modal behaviour.
The window manager can use this information to handle modal surfaces in a special way.
You should only use this on surfaces for which you have previously called set_transient_for()
modal | true if the surface is modal, false otherwise. |
void Gdk::Surface::set_opacity | ( | double | opacity | ) |
Set surface to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque.
(Values of the opacity parameter are clamped to the [0,1] range.)
For toplevel surfaces this depends on support from the windowing system that may not always be there. For instance, On X11, this works only on X screens with a compositing manager running. On Wayland, there is no per-surface opacity value that the compositor would apply. Instead, use gdk_surface_set_opaque_region (surface, <tt>nullptr</tt>)
to tell the compositor that the entire surface is (potentially) non-opaque, and draw your content with alpha, or use gtk_widget_set_opacity() to set an overall opacity for your widgets.
Support for non-toplevel surfaces was added in 3.8.
opacity | Opacity. |
void Gdk::Surface::set_opaque_region | ( | const ::Cairo::RefPtr< const ::Cairo::Region > & | region | ) |
For optimisation purposes, compositing window managers may like to not draw obscured regions of surfaces, or turn off blending during for these regions.
With RGB windows with no transparency, this is just the shape of the window, but with ARGB32 windows, the compositor does not know what regions of the window are transparent or not.
This function only works for toplevel surfaces.
GTK will update this property automatically if the surface background is opaque, as we know where the opaque regions are. If your surface background is not opaque, please update this property in your Gtk::Widget::property_css_changed() handler.
region | A region, or nullptr . |
void Gdk::Surface::set_shadow_width | ( | int | left, |
int | right, | ||
int | top, | ||
int | bottom | ||
) |
Newer GTK windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders.
Window managers that want to maximize windows or snap to edges need to know where the extents of the actual frame lie, so that users don’t feel like windows are snapping against random invisible edges.
Note that this property is automatically updated by GTK, so this function should only be used by applications which do not use GTK to create toplevel surfaces.
left | The left extent. |
right | The right extent. |
top | The top extent. |
bottom | The bottom extent. |
void Gdk::Surface::set_startup_id | ( | const Glib::ustring & | startup_id | ) |
When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.
startup_id | A string with startup-notification identifier. |
void Gdk::Surface::set_support_multidevice | ( | bool | support_multidevice = true | ) |
This function will enable multidevice features in surface.
Multidevice aware surfaces will need to handle properly multiple, per device enter/leave events, device grabs and grab ownerships.
support_multidevice | true to enable multidevice support in surface. |
void Gdk::Surface::set_title | ( | const Glib::ustring & | title | ) |
Sets the title of a toplevel surface, to be displayed in the titlebar.
If you haven’t explicitly set the icon name for the surface (using set_icon_name()), the icon name will be set to title as well. title must be in UTF-8 encoding (as with all user-readable strings in GDK and GTK). title may not be nullptr
.
title | Title of surface. |
void Gdk::Surface::set_transient_for | ( | const Glib::RefPtr< Surface >& | parent | ) |
Indicates to the window manager that surface is a transient dialog associated with the application surface parent.
This allows the window manager to do things like center surface on parent and keep surface above parent.
See gtk_window_set_transient_for() if you’re using Gtk::Window or Gtk::Dialog.
parent | Another toplevel Gdk::Surface. |
void Gdk::Surface::set_type_hint | ( | TypeHint | hint | ) |
The application can use this call to provide a hint to the surface manager about the functionality of a surface.
The window manager can use this information when determining the decoration and behaviour of the surface.
The hint must be set before the surface is mapped.
hint | A hint of the function this surface will have. |
void Gdk::Surface::show | ( | ) |
Like show_unraised(), but also raises the surface to the top of the surface stack (moves the surface to the front of the Z-order).
This function maps a surface so it’s visible onscreen. Its opposite is hide().
When implementing a Gtk::Widget, you should call this function on the widget's Gdk::Surface as part of the “map” method.
void Gdk::Surface::show_unraised | ( | ) |
Shows a Gdk::Surface onscreen, but does not modify its stacking order.
In contrast, show() will raise the surface to the top of the surface stack.
On the X11 platform, in Xlib terms, this function calls XMapWindow() (it also updates some internal GDK state, which means that you can’t really use XMapWindow() directly on a GDK surface).
bool Gdk::Surface::show_window_menu | ( | const Glib::RefPtr< const Event >& | event | ) |
Asks the windowing system to show the window menu.
The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.
event | A Gdk::Event to show the menu for. |
true
if the window menu was shown and false
otherwise. Glib::SignalProxy<bool(const Glib::RefPtr<const Event>&)> Gdk::Surface::signal_event | ( | ) |
bool on_my_event(const Glib::RefPtr<const Event>& event)
Flags: Run Last
Emitted when GDK receives an input event for surface.
event | An input event. |
true
to indicate that the event has been handled. Glib::SignalProxy<void(const Gdk::Rectangle&, const Gdk::Rectangle&, bool, bool)> Gdk::Surface::signal_moved_to_rect | ( | ) |
void on_my_moved_to_rect(const Gdk::Rectangle& flipped_rect, const Gdk::Rectangle& final_rect, bool flipped_x, bool flipped_y)
Flags: Run First
Emitted when the position of surface is finalized after being moved to a destination rectangle.
surface might be flipped over the destination rectangle in order to keep it on-screen, in which case flipped_x and flipped_y will be set to true
accordingly.
flipped_rect is the ideal position of surface after any possible flipping, but before any possible sliding. final_rect is flipped_rect, but possibly translated in the case that flipping is still ineffective in keeping surface on-screen. Stability: Private
flipped_rect | The position of surface after any possible flipping or nullptr if the backend can't obtain it. |
final_rect | The final position of surface or nullptr if the backend can't obtain it. |
flipped_x | true if the anchors were flipped horizontally. |
flipped_y | true if the anchors were flipped vertically. |
Glib::SignalProxy<bool(const ::Cairo::RefPtr<const ::Cairo::Region>&)> Gdk::Surface::signal_render | ( | ) |
bool on_my_render(const Cairo::RefPtr<const ::Cairo::Region>& expose_region)
Flags: Run Last
Emitted when part of the surface needs to be redrawn.
expose_region | The region that needs to be redrawn. |
true
to indicate that the signal has been handled. Glib::SignalProxy<void(int, int)> Gdk::Surface::signal_size_changed | ( | ) |
void on_my_size_changed(int width, int height)
Flags: Run First
Emitted when the size of surface is changed.
width | The new width. |
height | The new height. |
void Gdk::Surface::stick | ( | ) |
“Pins” a surface such that it’s on all workspaces and does not scroll with viewports, for window managers that have scrollable viewports.
(When using Gtk::Window, gtk_window_stick() may be more useful.)
On the X11 platform, this function depends on window manager support, so may have no effect with many window managers. However, GDK will do the best it can to convince the window manager to stick the surface. For window managers that don’t support this operation, there’s nothing you can do to force it to happen.
void Gdk::Surface::thaw_updates | ( | ) |
Thaws a surface frozen with freeze_updates().
Note that this will not necessarily schedule updates if the surface freeze count reaches zero.
void Gdk::Surface::unfullscreen | ( | ) |
Moves the surface out of fullscreen mode.
If the surface was not fullscreen, does nothing.
On X11, asks the window manager to move surface out of the fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the unfullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
void Gdk::Surface::unmaximize | ( | ) |
Unmaximizes the surface.
If the surface wasn’t maximized, then this function does nothing.
On X11, asks the window manager to unmaximize surface, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the unmaximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
On Windows, reliably unmaximizes the surface.
void Gdk::Surface::unminimize | ( | ) |
Asks to unminimize the surface.
The windowing system may choose to ignore the request.
You can track the result of this request by using the Gdk::Surface::property_state() property.
This function only makes sense when surface is a toplevel surface.
void Gdk::Surface::unset_icon | ( | ) |
void Gdk::Surface::unstick | ( | ) |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |