mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #2778 See merge request GNOME/gtk!1966
This commit is contained in:
commit
bd3f4599ed
@ -231,8 +231,8 @@ whether Xinerama should be used.
|
||||
The *gtk-doc* package is used to generate the reference documentation
|
||||
included with GTK. By default support for *gtk-doc* is disabled
|
||||
because it requires various extra dependencies to be installed.
|
||||
If you have *gtk-doc* installed and are modifying GTK, you may want
|
||||
to enable *gtk-doc* support by passing in `-Dgtk_doc=true`.
|
||||
If you have *gtk-doc* and *pandoc* installed and are modifying GTK,
|
||||
you may want to enable *gtk-doc* support by passing in `-Dgtk_doc=true`.
|
||||
|
||||
Additionally, some tools provided by GTK have their own
|
||||
manual pages generated using a similar set of dependencies;
|
||||
|
@ -378,6 +378,20 @@ with gtk_container_set_focus_vadjustment() has been removed together with
|
||||
GtkContainer, and is provided by scrollable widgets instead. In the common
|
||||
case that the scrollable is a #GtkViewport, use #GtkViewport:scroll-to-focus.
|
||||
|
||||
### Use the new apis for keyboard shortcuts
|
||||
|
||||
The APIs for keyboard shortcuts and accelerators have changed in GTK 4.
|
||||
|
||||
Instead of GtkAccelGroup, you now use a #GtkShortcutController with global
|
||||
scope, and instead of GtkBindingSet, you now use gtk_widget_class_add_shortcut(),
|
||||
gtk_widget_class_add_binding() and its variants. In both cases, you probably
|
||||
want to add actions that can be triggered by your shortcuts.
|
||||
|
||||
There is no direct replacement for loading and saving accelerators with
|
||||
GtkAccelMap. But since #GtkShortcutController implements #GListModel and
|
||||
both #GtkShortcutTrigger and #GtkShortcutAction can be serialized to
|
||||
strings, it is relatively easy to implement saving and loading yourself.
|
||||
|
||||
### Stop using GtkEventBox
|
||||
|
||||
GtkEventBox is no longer needed and has been removed.
|
||||
|
@ -412,6 +412,7 @@ update_direction (GdkWaylandKeymap *keymap)
|
||||
gint layouts, layout;
|
||||
|
||||
layouts = xkb_keymap_num_layouts_for_key (keymap->xkb_keymap, key);
|
||||
g_assert (layouts <= num_layouts);
|
||||
for (layout = 0; layout < layouts; layout++)
|
||||
{
|
||||
const xkb_keysym_t *syms;
|
||||
|
@ -540,9 +540,6 @@ gtk_accelerator_name_with_keycode (GdkDisplay *display,
|
||||
{
|
||||
gchar *gtk_name;
|
||||
|
||||
if (display == NULL)
|
||||
display = gdk_display_manager_get_default_display (gdk_display_manager_get ());
|
||||
|
||||
gtk_name = gtk_accelerator_name (accelerator_key, accelerator_mods);
|
||||
|
||||
if (!accelerator_key)
|
||||
@ -658,9 +655,6 @@ gtk_accelerator_get_label_with_keycode (GdkDisplay *display,
|
||||
{
|
||||
gchar *gtk_label;
|
||||
|
||||
if (display == NULL)
|
||||
display = gdk_display_manager_get_default_display (gdk_display_manager_get ());
|
||||
|
||||
gtk_label = gtk_accelerator_get_label (accelerator_key, accelerator_mods);
|
||||
|
||||
if (!accelerator_key)
|
||||
|
@ -124,6 +124,8 @@ _gtk_bitmask_invert_range (GtkBitmask *mask,
|
||||
guint start,
|
||||
guint end)
|
||||
{
|
||||
g_assert (start <= end);
|
||||
|
||||
if (_gtk_bitmask_is_allocated (mask) ||
|
||||
(end > GTK_BITMASK_N_DIRECT_BITS))
|
||||
return _gtk_allocated_bitmask_invert_range (mask, start, end);
|
||||
|
@ -1716,8 +1716,8 @@ cups_job_poll_data_free (CupsJobPollData *data)
|
||||
|
||||
static void
|
||||
cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
||||
GtkCupsResult *result,
|
||||
gpointer user_data)
|
||||
GtkCupsResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
CupsJobPollData *data = user_data;
|
||||
ipp_attribute_t *attr;
|
||||
@ -1735,8 +1735,6 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
||||
|
||||
response = gtk_cups_result_get_response (result);
|
||||
|
||||
state = 0;
|
||||
|
||||
attr = ippFindAttribute (response, "job-state", IPP_TAG_ENUM);
|
||||
state = ippGetInteger (attr, 0);
|
||||
|
||||
@ -1746,24 +1744,20 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
||||
case IPP_JOB_PENDING:
|
||||
case IPP_JOB_HELD:
|
||||
case IPP_JOB_STOPPED:
|
||||
gtk_print_job_set_status (data->job,
|
||||
GTK_PRINT_STATUS_PENDING);
|
||||
gtk_print_job_set_status (data->job, GTK_PRINT_STATUS_PENDING);
|
||||
break;
|
||||
case IPP_JOB_PROCESSING:
|
||||
gtk_print_job_set_status (data->job,
|
||||
GTK_PRINT_STATUS_PRINTING);
|
||||
gtk_print_job_set_status (data->job, GTK_PRINT_STATUS_PRINTING);
|
||||
break;
|
||||
default:
|
||||
case IPP_JOB_CANCELLED:
|
||||
case IPP_JOB_ABORTED:
|
||||
gtk_print_job_set_status (data->job,
|
||||
GTK_PRINT_STATUS_FINISHED_ABORTED);
|
||||
gtk_print_job_set_status (data->job, GTK_PRINT_STATUS_FINISHED_ABORTED);
|
||||
done = TRUE;
|
||||
break;
|
||||
case 0:
|
||||
case IPP_JOB_COMPLETED:
|
||||
gtk_print_job_set_status (data->job,
|
||||
GTK_PRINT_STATUS_FINISHED);
|
||||
gtk_print_job_set_status (data->job, GTK_PRINT_STATUS_FINISHED);
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
@ -1774,11 +1768,11 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
||||
guint id;
|
||||
|
||||
if (data->counter < 5)
|
||||
timeout = 100;
|
||||
timeout = 100;
|
||||
else if (data->counter < 10)
|
||||
timeout = 500;
|
||||
timeout = 500;
|
||||
else
|
||||
timeout = 1000;
|
||||
timeout = 1000;
|
||||
|
||||
id = g_timeout_add (timeout, cups_job_info_poll_timeout, data);
|
||||
g_source_set_name_by_id (id, "[gtk] cups_job_info_poll_timeout");
|
||||
|
Loading…
Reference in New Issue
Block a user