Compare commits
5 Commits
wip/antoni
...
wip.win32.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65cafa32e2 | ||
|
|
cfcc1b79d3 | ||
|
|
d35e1e78ea | ||
|
|
9cf31641a5 | ||
|
|
37fc7ec3af |
@@ -239,7 +239,7 @@ executable('gtk4-demo',
|
||||
c_args: demo_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
win_subsystem: 'windows',
|
||||
# win_subsystem: 'windows',
|
||||
link_args: extra_demo_ldflags,
|
||||
install: true,
|
||||
)
|
||||
@@ -249,7 +249,7 @@ executable('gtk4-demo-application',
|
||||
c_args: common_cflags,
|
||||
dependencies: gtkdemo_deps,
|
||||
include_directories: confinc,
|
||||
win_subsystem: 'windows',
|
||||
# win_subsystem: 'windows',
|
||||
link_args: extra_demo_ldflags,
|
||||
install: true,
|
||||
)
|
||||
|
||||
@@ -68,7 +68,7 @@ executable('gtk4-widget-factory',
|
||||
c_args: common_cflags,
|
||||
dependencies: [ libgtk_dep, profile_conf_h ],
|
||||
include_directories: confinc,
|
||||
win_subsystem: 'windows',
|
||||
# win_subsystem: 'windows',
|
||||
link_args: extra_demo_ldflags,
|
||||
install: true,
|
||||
)
|
||||
|
||||
@@ -68,7 +68,7 @@ gdk_win32_cairo_context_begin_frame (GdkDrawContext *draw_context,
|
||||
surface = gdk_draw_context_get_surface (draw_context);
|
||||
scale = gdk_surface_get_scale_factor (surface);
|
||||
|
||||
queued_hwnd_rect = gdk_win32_surface_handle_queued_move_resize (draw_context);
|
||||
queued_hwnd_rect = gdk_win32_surface_handle_queued_move_resize (surface);
|
||||
|
||||
width = queued_hwnd_rect.right - queued_hwnd_rect.left;
|
||||
height = queued_hwnd_rect.bottom - queued_hwnd_rect.top;
|
||||
|
||||
@@ -795,11 +795,7 @@ gdk_drag_new (GdkDisplay *display,
|
||||
NULL);
|
||||
|
||||
drag = GDK_DRAG (drag_win32);
|
||||
|
||||
if (display_win32->has_fixed_scale)
|
||||
drag_win32->scale = display_win32->surface_scale;
|
||||
else
|
||||
drag_win32->scale = gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL);
|
||||
drag_win32->scale = display_win32->surface_scale;
|
||||
|
||||
drag_win32->dnd_thread_items = display_win32->cb_dnd_items->clipdrop->dnd_thread_items;
|
||||
|
||||
@@ -1911,7 +1907,6 @@ gdk_win32_drag_drop_done (GdkDrag *drag,
|
||||
if (success)
|
||||
{
|
||||
gdk_surface_hide (drag_win32->drag_surface);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,11 +177,7 @@ gdk_drop_new (GdkDisplay *display,
|
||||
"surface", surface,
|
||||
NULL);
|
||||
|
||||
if (display_win32->has_fixed_scale)
|
||||
drop_win32->scale = display_win32->surface_scale;
|
||||
else
|
||||
drop_win32->scale = gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL);
|
||||
|
||||
drop_win32->scale = display_win32->surface_scale;
|
||||
drop_win32->protocol = protocol;
|
||||
|
||||
return GDK_DROP (drop_win32);
|
||||
|
||||
@@ -114,7 +114,9 @@ gdk_win32_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
|
||||
GdkColorState **out_color_state,
|
||||
GdkMemoryDepth *out_depth)
|
||||
{
|
||||
gdk_win32_surface_handle_queued_move_resize (draw_context);
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
||||
|
||||
gdk_win32_surface_handle_queued_move_resize (surface);
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, depth, update_area, out_color_state, out_depth);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
|
||||
GdkColorState **out_color_state,
|
||||
GdkMemoryDepth *out_depth)
|
||||
{
|
||||
gdk_win32_surface_handle_queued_move_resize (draw_context);
|
||||
gdk_win32_surface_handle_queued_move_resize (gdk_draw_context_get_surface (draw_context));
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, depth, update_area, out_color_state, out_depth);
|
||||
}
|
||||
|
||||
@@ -3045,6 +3045,14 @@ handle_aerosnap_move_resize (GdkSurface *surface,
|
||||
int halfright = 0;
|
||||
int fullup = 0;
|
||||
gboolean fullup_edge = FALSE;
|
||||
GdkWin32Surface *impl = GDK_WIN32_SURFACE (surface);
|
||||
|
||||
if (context->op == GDK_WIN32_DRAGOP_MOVE)
|
||||
{
|
||||
if (impl->toplevel_layout != NULL &&
|
||||
!gdk_toplevel_layout_get_resizable (impl->toplevel_layout))
|
||||
return;
|
||||
}
|
||||
|
||||
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
|
||||
switch (context->edge)
|
||||
@@ -4489,8 +4497,11 @@ _gdk_win32_surface_compute_size (GdkSurface *surface)
|
||||
if (!impl->drag_move_resize_context.native_move_resize_pending)
|
||||
{
|
||||
bool size_changed;
|
||||
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_surface_get_display (surface));
|
||||
|
||||
if (GDK_IS_TOPLEVEL (surface) && impl->force_recompute_size)
|
||||
if (GDK_IS_TOPLEVEL (surface) &&
|
||||
impl->force_recompute_size &&
|
||||
!(display->display_surface_record->modal_operation_in_progress & GDK_WIN32_MODAL_OP_SIZEMOVE_MASK))
|
||||
{
|
||||
size_changed = width != surface->width ||
|
||||
height != surface->height;
|
||||
@@ -5109,14 +5120,12 @@ gdk_win32_surface_apply_queued_move_resize (GdkSurface *surface,
|
||||
}
|
||||
|
||||
RECT
|
||||
gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context)
|
||||
gdk_win32_surface_handle_queued_move_resize (GdkSurface *surface)
|
||||
{
|
||||
GdkSurface *surface;
|
||||
GdkWin32Surface *impl;
|
||||
int scale;
|
||||
RECT queued_hwnd_rect;
|
||||
|
||||
surface = gdk_draw_context_get_surface (draw_context);
|
||||
impl = GDK_WIN32_SURFACE (surface);
|
||||
scale = gdk_surface_get_scale_factor (surface);
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ void gdk_win32_surface_move_resize (GdkSurface *surface,
|
||||
GdkSurface *gdk_win32_drag_surface_new (GdkDisplay *display);
|
||||
|
||||
RECT
|
||||
gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);
|
||||
gdk_win32_surface_handle_queued_move_resize (GdkSurface *surface);
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
EGLSurface gdk_win32_surface_get_egl_surface (GdkSurface *surface,
|
||||
|
||||
@@ -63,7 +63,9 @@ gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
||||
GdkColorState **out_color_state,
|
||||
GdkMemoryDepth *out_depth)
|
||||
{
|
||||
gdk_win32_surface_handle_queued_move_resize (draw_context);
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
||||
|
||||
gdk_win32_surface_handle_queued_move_resize (surface);
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, depth, update_area, out_color_state, out_depth);
|
||||
}
|
||||
|
||||
@@ -448,23 +448,6 @@ gtk_list_base_select_item (GtkListBase *self,
|
||||
0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_listitem_select_action (GtkListBasePrivate *priv,
|
||||
guint pos,
|
||||
gboolean modify,
|
||||
gboolean extend)
|
||||
{
|
||||
GtkListTile *tile;
|
||||
|
||||
tile = gtk_list_item_manager_get_nth (priv->item_manager, pos, NULL);
|
||||
|
||||
/* We do this convoluted calling into the widget because that way
|
||||
* GtkListItem::selectable gets respected, which is what one would expect.
|
||||
*/
|
||||
g_assert (tile->widget);
|
||||
gtk_widget_activate_action (tile->widget, "listitem.select", "(bb)", modify, extend);
|
||||
}
|
||||
|
||||
/*
|
||||
* gtk_list_base_grab_focus_on_item:
|
||||
* @self: a `GtkListBase`
|
||||
@@ -523,7 +506,13 @@ gtk_list_base_grab_focus_on_item (GtkListBase *self,
|
||||
|
||||
if (select)
|
||||
{
|
||||
activate_listitem_select_action (priv, pos, modify, extend);
|
||||
tile = gtk_list_item_manager_get_nth (priv->item_manager, pos, NULL);
|
||||
|
||||
/* We do this convoluted calling into the widget because that way
|
||||
* GtkListItem::selectable gets respected, which is what one would expect.
|
||||
*/
|
||||
g_assert (tile->widget);
|
||||
gtk_widget_activate_action (tile->widget, "listitem.select", "(bb)", modify, extend);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -1142,34 +1131,6 @@ gtk_list_base_move_cursor_to_end (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_selecting_unselected_cursor (GtkListBase *self,
|
||||
guint position,
|
||||
gboolean select,
|
||||
gboolean modify,
|
||||
gboolean extend)
|
||||
{
|
||||
GtkListBasePrivate *priv = gtk_list_base_get_instance_private (self);
|
||||
GtkSelectionModel *model;
|
||||
|
||||
/* If Ctrl is pressed, we don't want to reset the selection. */
|
||||
if (!select || modify)
|
||||
return FALSE;
|
||||
|
||||
model = gtk_list_item_manager_get_model (priv->item_manager);
|
||||
|
||||
/* Selection of current position is not needed if it's already selected or if
|
||||
* there is nothing to select. */
|
||||
if (model == NULL || gtk_selection_model_is_selected (model, position))
|
||||
return FALSE;
|
||||
|
||||
/* Reset cursor to current position trying to select it as well. */
|
||||
activate_listitem_select_action (priv, position, FALSE, extend);
|
||||
|
||||
/* Report whether the model allowed the selection change. */
|
||||
return gtk_selection_model_is_selected (model, position);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_list_base_move_cursor (GtkWidget *widget,
|
||||
GVariant *args,
|
||||
@@ -1184,12 +1145,6 @@ gtk_list_base_move_cursor (GtkWidget *widget,
|
||||
g_variant_get (args, "(ubbbi)", &orientation, &select, &modify, &extend, &amount);
|
||||
|
||||
old_pos = gtk_list_base_get_focus_position (self);
|
||||
|
||||
/* When the focus is on an unselected item while we're selecting, we want to
|
||||
* not move focus but select the focused item instead if we can. */
|
||||
if (handle_selecting_unselected_cursor (self, old_pos, select, modify, extend))
|
||||
return TRUE;
|
||||
|
||||
new_pos = gtk_list_base_move_focus (self, old_pos, orientation, amount);
|
||||
|
||||
if (old_pos != new_pos)
|
||||
|
||||
Reference in New Issue
Block a user