Compare commits
268 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f604f26c8 | |||
| 8fac19ab52 | |||
| 3147b76116 | |||
| 66431ae1e5 | |||
| e608a18043 | |||
| d8266bb4e3 | |||
| c71f8d0838 | |||
| 043c89dbe2 | |||
| 78233d56cf | |||
| f237c85c8f | |||
| 87b2fe6de3 | |||
| 370b1fe3d5 | |||
| f5516845d4 | |||
| bfb069ea5a | |||
| 3c1a300e17 | |||
| 7a3a82749b | |||
| e944cd8916 | |||
| 9d633773b0 | |||
| 9ccff25c15 | |||
| 384deb5da7 | |||
| f0c27b7c8e | |||
| 98a2aae5ac | |||
| fa1c48adda | |||
| 8362e18891 | |||
| 08d4d63446 | |||
| a358203157 | |||
| 00cdaba5a8 | |||
| 63bd793004 | |||
| 97e6c7228a | |||
| 9ffbeb2f21 | |||
| ce86609f42 | |||
| 55bc7808cc | |||
| b77a5fedd2 | |||
| afea4a8da5 | |||
| 03df96bace | |||
| e16f71304f | |||
| 18482ac484 | |||
| c9d6074198 | |||
| f647d7e687 | |||
| 2f6d374fe2 | |||
| bd906560dd | |||
| e86d18d77c | |||
| c709a8d668 | |||
| ecfb2b8cdf | |||
| dfc66ffd93 | |||
| 7513fd5d64 | |||
| 6c9a1c51ba | |||
| 8de231131c | |||
| 25f8793a35 | |||
| f02b739f4c | |||
| a55b84f524 | |||
| ba69a30d27 | |||
| 5abff9e22a | |||
| 6a172090aa | |||
| 36b4903e0c | |||
| 2092d21bad | |||
| 23c044d060 | |||
| 9de18be775 | |||
| 10c62d9e72 | |||
| dc82959ac1 | |||
| e435d8b93c | |||
| 97ac0a4587 | |||
| a8ec2d6b9e | |||
| e8869391bb | |||
| b902838344 | |||
| 830d28df90 | |||
| 41696b0c57 | |||
| 49d06736a5 | |||
| b4acfc890b | |||
| 51140f2b3a | |||
| 999f503eec | |||
| 7ef7dee97e | |||
| e67bfe453e | |||
| 630392c18f | |||
| 39475ead3b | |||
| 84b5209e0c | |||
| b1fe1c3417 | |||
| 062f9aa0eb | |||
| 14ec1e3388 | |||
| 97f889d96c | |||
| 3a88cbd9b9 | |||
| a1c7935d9d | |||
| 17da269a5f | |||
| db5286d670 | |||
| 3f04251224 | |||
| 17c5297aef | |||
| b88b4919be | |||
| bb3a6214cb | |||
| c403656620 | |||
| faa700e3a4 | |||
| 35e813c814 | |||
| dc306aec28 | |||
| 915dd6583a | |||
| a6931a66c5 | |||
| c163f74d99 | |||
| cfa3f25934 | |||
| 38f9803f45 | |||
| 541de3451c | |||
| b41af7b983 | |||
| b686ce1cb6 | |||
| 954011ef80 | |||
| 3fe1fb4930 | |||
| 966a23503a | |||
| d2490c30b1 | |||
| ada4272aa9 | |||
| 4a187d7f1d | |||
| 4f47683710 | |||
| 7470bc01f2 | |||
| e2784e81cc | |||
| 5a110c1bdd | |||
| 003a9c7e07 | |||
| 68fe4fb0a8 | |||
| 80f74a8e37 | |||
| 06b3ced8e7 | |||
| 3730fd4632 | |||
| be2b12f904 | |||
| b351c10dae | |||
| 30f2bf9761 | |||
| 2a0d111505 | |||
| 3bba2dbb9d | |||
| 5bc3284dd8 | |||
| 5377bd0422 | |||
| 3b24fc7a07 | |||
| 0bf8a39177 | |||
| 7a4b3faec6 | |||
| f0f1228982 | |||
| b03f21193b | |||
| 4e305e215b | |||
| 3f29f65396 | |||
| d55d3fc3fe | |||
| fe9096a959 | |||
| 91ca51222a | |||
| f0560c8cdb | |||
| 8178465c1a | |||
| 555c7e9ee2 | |||
| 79d8220908 | |||
| 7417d30a1f | |||
| f492e37354 | |||
| 22ff7bceff | |||
| 116324e21c | |||
| f9810d76ae | |||
| 8b8f493bba | |||
| 2634e2b74b | |||
| 56503cd623 | |||
| 47070e5663 | |||
| 8c1e61d54c | |||
| d9fbcdb82e | |||
| 439dec9a54 | |||
| e63a066ced | |||
| f66b6e5059 | |||
| ca12226e7c | |||
| 2ac3d0a59d | |||
| 353cec50c8 | |||
| d11ac6d83e | |||
| 51f6129578 | |||
| 9a10d16f69 | |||
| ec9b0ec8b4 | |||
| 4e340afce0 | |||
| 7d634f8671 | |||
| ada1e212f1 | |||
| 22cf3e9269 | |||
| 8415c5f375 | |||
| 126b847fdd | |||
| dd6ea529f8 | |||
| 1ab1885540 | |||
| 3f1a083cfa | |||
| c6fc895b6d | |||
| 18720031a3 | |||
| 7e1a4b5b7c | |||
| 60ea127592 | |||
| 3287199f37 | |||
| 9be7e170b8 | |||
| 9f50647ddb | |||
| fa4af02531 | |||
| 2e8a32db26 | |||
| 33fc6cc479 | |||
| a058a382d4 | |||
| cad7247f2d | |||
| a1ad1fc9db | |||
| 5f0a9a60e9 | |||
| fcec5a817e | |||
| 9782158a9e | |||
| 67310c8753 | |||
| e09a5bc2dd | |||
| a14ac90229 | |||
| 67d8b4c976 | |||
| 6a566648d2 | |||
| 1b07d02671 | |||
| 47e90f1de6 | |||
| 1b2ae02b26 | |||
| b02ade43c3 | |||
| bb48a02a77 | |||
| 4897ff0278 | |||
| 40fdf4aa9f | |||
| 354ceb5778 | |||
| 7cf72976d9 | |||
| 243f4b0729 | |||
| b4d33c0810 | |||
| 24f615cad1 | |||
| 370b72c674 | |||
| 806639d974 | |||
| 9ca65eb787 | |||
| ee22a3ea36 | |||
| dd8bd8ad15 | |||
| 53655c1041 | |||
| 28e56d0dde | |||
| 6a797f6b1a | |||
| 6b5baefd75 | |||
| a6010b40f2 | |||
| 80c765b54d | |||
| 1b872743bc | |||
| 3e26418dfe | |||
| 78931915e4 | |||
| 15a62434f4 | |||
| e041f7bf71 | |||
| f15aa82eaf | |||
| 625219508b | |||
| 520b25e96c | |||
| f00b29f2c6 | |||
| 5c20cb08dc | |||
| 5d8bf6d9ca | |||
| ea6f176055 | |||
| eec1298aa1 | |||
| 61536ea1a7 | |||
| 340ab6c20f | |||
| 2229ff6807 | |||
| 7bc18a125f | |||
| 5303bbf66a | |||
| c2f432b6df | |||
| e0a48a215f | |||
| 1be7a1f18f | |||
| 3458ebf8c9 | |||
| 1bd53839c6 | |||
| 427f65bac4 | |||
| 78bdfe9db9 | |||
| 76c6a55206 | |||
| 3fc6acf638 | |||
| 2b8bf0236a | |||
| c80d712d35 | |||
| 3c5b8be62e | |||
| 5df9d4a727 | |||
| 8cefb950d0 | |||
| 804d6cf6c9 | |||
| c8bedb7d3d | |||
| d80cecec06 | |||
| 678e11ecb5 | |||
| b35898abf8 | |||
| 6cddd96eb7 | |||
| 96c47b8c6e | |||
| c9987d4889 | |||
| d0648a5c6e | |||
| 04dc23d047 | |||
| c95d677083 | |||
| d87ac9761d | |||
| ea7acdace3 | |||
| f55cbf5643 | |||
| a1912482ce | |||
| 8d18ef4f5c | |||
| 9af8f92ba1 | |||
| d31dc4343b | |||
| ce651ee924 | |||
| 96e0c0f095 | |||
| f548ee93a2 | |||
| a2d29d6a72 | |||
| 2c34a8a970 | |||
| bd181cab67 | |||
| f4a7c2a7c5 | |||
| 40bc44503a |
@@ -1,6 +1,121 @@
|
||||
Overview of Changes in 4.10.2, xx-xx-xxxx
|
||||
Overview of Changes in 4.10.6, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
Overview of Changes in 4.10.5, 05-08-2023
|
||||
=========================================
|
||||
|
||||
* Fix ordering problems with filter model signals
|
||||
|
||||
* Avoid lingering resize cursors
|
||||
|
||||
* Fix alignment issues on sparc
|
||||
|
||||
* Fix a problem with CSS corner values
|
||||
|
||||
* Translation updates
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
Greek
|
||||
Spanish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in 4.10.4, 05-06-2023
|
||||
=========================================
|
||||
|
||||
* GtkFileChooser
|
||||
- Fix some memory leaks
|
||||
|
||||
* GtkUriLauncher
|
||||
- Validate the uri
|
||||
|
||||
* GtkStack
|
||||
- Fix a crash
|
||||
|
||||
* GtkGridView
|
||||
- Respect css border-spacing
|
||||
|
||||
* GtkScrolledWindow
|
||||
- Propagate child measure size whenever possible
|
||||
|
||||
* GtkPopoverMenu:
|
||||
- Avoid unnecessary left padding
|
||||
|
||||
* GtkSearchEntry:
|
||||
- Improve size allocation for the clear icon
|
||||
|
||||
* X11
|
||||
- Avoid black flickering with xwayland window decorations
|
||||
- Trap XRandr errors
|
||||
|
||||
* CSS
|
||||
- Various fixes to transitions
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Catalan
|
||||
Chinese (China)
|
||||
French
|
||||
Galician
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Persian
|
||||
Russian
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.10.3, 22-04-2023
|
||||
=========================================
|
||||
|
||||
* Fix a popover positioning regression in 4.10.2
|
||||
|
||||
* Fix issues with slow loading files in the file chooser
|
||||
|
||||
|
||||
Overview of Changes in 4.10.2, 21-04-2023
|
||||
=========================================
|
||||
|
||||
* Fixed issues:
|
||||
- Holding control to select multiple files broken in filechooser (#5669)
|
||||
- Inspector crash (#5681)
|
||||
- Listbase doesn't account for bottom padding in size_allocate_child (#5380)
|
||||
- Leaking AT contexts (#5690)
|
||||
- OpenGL / Windows: Crash when closing gtk4-widget-factory (#5685)
|
||||
- GTK apps crash on startup when setting cursor-size to 0 on Wayland (#5700)
|
||||
- Segmentation fault: gdk_wayland_toplevel_set_startup_id() needs to null-check
|
||||
display->xdg_activation before using it (#5701)
|
||||
- Possible use-after-free under gtk_scrolled_window_update_use_indicators() (#5684)
|
||||
- Wrong error message in `gtk_init` (#5704)
|
||||
- Segfault when scrolling after changing ListView model (#5763)
|
||||
- Bluetooth panel from the Settings app: clicking in the "Downloads" link
|
||||
no longer opens Nautilus (#5671)
|
||||
- Broadway docs or code is broken (#5662)
|
||||
- Disabled GtkPicture's are not properly themed (#5683)
|
||||
- Setting CSS padding to a GtkTextView gives the context menu an offset (#5695)
|
||||
- A11y: the Showing state is used only for windows (#5194)
|
||||
- Gtk4 expander: CSS nodes mismatch code vs. documentation (#5723)
|
||||
- Invoking gtk inspector on a folder results in a crash (#5729)
|
||||
- Double tap requires very precise touch input (#5580)
|
||||
- Name autocompletion dropdown in the GTK4 FileChooser's Save dialog gets
|
||||
stuck, creates artifacts, jumps around (#5743)
|
||||
- Links are not opened when xdg-desktop-portal OpenURI is not available (#5733)
|
||||
- GtkSnapshot generates no nodes appending whitespace-only layouts (#5747)
|
||||
|
||||
* Translation updates
|
||||
British English
|
||||
Bulgarian
|
||||
Chinese (China)
|
||||
French
|
||||
Indonesian
|
||||
Korean
|
||||
Russian
|
||||
Serbian
|
||||
Slovenian
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.10.1, 14-03-2023
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -224,7 +224,14 @@ demo3_widget_set_property (GObject *object,
|
||||
case PROP_TEXTURE:
|
||||
g_clear_object (&self->texture);
|
||||
self->texture = g_value_dup_object (value);
|
||||
self->scale = 1.f;
|
||||
self->angle = 0.f;
|
||||
self->filter = GSK_SCALING_FILTER_LINEAR;
|
||||
update_actions (self);
|
||||
gtk_widget_queue_resize (GTK_WIDGET (object));
|
||||
g_object_notify (object, "scale");
|
||||
g_object_notify (object, "angle");
|
||||
g_object_notify (object, "filter");
|
||||
break;
|
||||
|
||||
case PROP_SCALE:
|
||||
|
||||
+195
-203
@@ -30,90 +30,86 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<signal name="row-activated" handler="row_activated"/>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
<class name="boxed-list"/>
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="show-separators">1</property>
|
||||
<signal name="row-activated" handler="row_activated"/>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
</style>
|
||||
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="switch_label">
|
||||
<property name="label" translatable="yes">Switch</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkLabel" id="switch_label">
|
||||
<property name="label" translatable="yes">Switch</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="check_label">
|
||||
<property name="label" translatable="yes">Check</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="check">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkLabel" id="check_label">
|
||||
<property name="label" translatable="yes">Check</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="check">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="image_label">
|
||||
<property name="label" translatable="yes">Click here!</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image">
|
||||
<property name="icon-name">object-select-symbolic</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="opacity">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkLabel" id="image_label">
|
||||
<property name="label" translatable="yes">Click here!</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image">
|
||||
<property name="icon-name">object-select-symbolic</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="opacity">0</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -134,146 +130,142 @@
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="show-separators">1</property>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
<class name="boxed-list"/>
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="scale_label">
|
||||
<property name="label" translatable="yes">Scale</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="width-request">150</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="scale_label">
|
||||
<property name="label" translatable="yes">Scale</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="width-request">150</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="spin_label">
|
||||
<property name="label" translatable="yes">Spinbutton</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="dropdown_label">
|
||||
<property name="label" translatable="yes">Dropdown</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropDown">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item>Choice 1</item>
|
||||
<item>Choice 2</item>
|
||||
<item>Choice 3</item>
|
||||
<item>Choice 4</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="spin_label">
|
||||
<property name="label" translatable="yes">Spinbutton</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="upper">100</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">10</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="dropdown_label">
|
||||
<property name="label" translatable="yes">Dropdown</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDropDown">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="model">
|
||||
<object class="GtkStringList">
|
||||
<items>
|
||||
<item>Choice 1</item>
|
||||
<item>Choice 2</item>
|
||||
<item>Choice 3</item>
|
||||
<item>Choice 4</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="entry_label">
|
||||
<property name="label" translatable="yes">Entry</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="placeholder-text">Type here…</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="entry_label">
|
||||
<property name="label" translatable="yes">Entry</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="placeholder-text">Type here…</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
+26
-8
@@ -24,6 +24,7 @@ typedef struct
|
||||
GdkRGBA draw_color;
|
||||
GtkPadController *pad_controller;
|
||||
double brush_size;
|
||||
GtkGesture *gesture;
|
||||
} DrawingArea;
|
||||
|
||||
typedef struct
|
||||
@@ -262,7 +263,7 @@ drawing_area_apply_stroke (DrawingArea *area,
|
||||
double y,
|
||||
double pressure)
|
||||
{
|
||||
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
|
||||
if (tool && gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
|
||||
{
|
||||
cairo_set_line_width (area->cr, 10 * pressure * area->brush_size);
|
||||
cairo_set_operator (area->cr, CAIRO_OPERATOR_DEST_OUT);
|
||||
@@ -313,7 +314,9 @@ stylus_gesture_motion (GtkGestureStylus *gesture,
|
||||
drawing_area_apply_stroke (area, tool,
|
||||
backlog[i].axes[GDK_AXIS_X],
|
||||
backlog[i].axes[GDK_AXIS_Y],
|
||||
backlog[i].axes[GDK_AXIS_PRESSURE]);
|
||||
backlog[i].flags & GDK_AXIS_FLAG_PRESSURE
|
||||
? backlog[i].axes[GDK_AXIS_PRESSURE]
|
||||
: 1);
|
||||
}
|
||||
|
||||
g_free (backlog);
|
||||
@@ -343,6 +346,8 @@ drawing_area_init (DrawingArea *area)
|
||||
|
||||
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
|
||||
area->brush_size = 1;
|
||||
|
||||
area->gesture = gesture;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -381,6 +386,12 @@ drawing_area_color_set (DrawingArea *area,
|
||||
gtk_color_dialog_button_set_rgba (button, color);
|
||||
}
|
||||
|
||||
static GtkGesture *
|
||||
drawing_area_get_gesture (DrawingArea *area)
|
||||
{
|
||||
return area->gesture;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_paint (GtkWidget *toplevel)
|
||||
{
|
||||
@@ -388,7 +399,7 @@ do_paint (GtkWidget *toplevel)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *draw_area, *headerbar, *colorbutton;
|
||||
GtkWidget *draw_area, *headerbar, *button;
|
||||
|
||||
window = gtk_window_new ();
|
||||
|
||||
@@ -397,15 +408,22 @@ do_paint (GtkWidget *toplevel)
|
||||
|
||||
headerbar = gtk_header_bar_new ();
|
||||
|
||||
colorbutton = gtk_color_dialog_button_new (gtk_color_dialog_new ());
|
||||
g_signal_connect (colorbutton, "notify::rgba",
|
||||
button = gtk_color_dialog_button_new (gtk_color_dialog_new ());
|
||||
g_signal_connect (button, "notify::rgba",
|
||||
G_CALLBACK (color_button_color_set), draw_area);
|
||||
g_signal_connect (draw_area, "color-set",
|
||||
G_CALLBACK (drawing_area_color_set), colorbutton);
|
||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (colorbutton),
|
||||
G_CALLBACK (drawing_area_color_set), button);
|
||||
gtk_color_dialog_button_set_rgba (GTK_COLOR_DIALOG_BUTTON (button),
|
||||
&(GdkRGBA) { 0, 0, 0, 1 });
|
||||
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), button);
|
||||
|
||||
button = gtk_check_button_new_with_label ("Stylus only");
|
||||
g_object_bind_property (button, "active",
|
||||
drawing_area_get_gesture ((DrawingArea *)draw_area), "stylus-only",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), button);
|
||||
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Paint");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Overlay/Transparency
|
||||
* #Keywords: GtkOverlay, GtkSnapshot
|
||||
* #Keywords: GtkOverlay, GtkSnapshot, blur
|
||||
*
|
||||
* Blur the background behind an overlay.
|
||||
*/
|
||||
|
||||
@@ -174,6 +174,7 @@ text_changed (GtkTextBuffer *buffer,
|
||||
GtkTextIter iter;
|
||||
GtkTextIter start, end;
|
||||
float scale;
|
||||
GskRenderNode *big_node;
|
||||
|
||||
g_array_remove_range (self->errors, 0, self->errors->len);
|
||||
text = get_current_text (self->text_buffer);
|
||||
@@ -186,13 +187,18 @@ text_changed (GtkTextBuffer *buffer,
|
||||
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
|
||||
|
||||
scale = gtk_scale_button_get_value (GTK_SCALE_BUTTON (self->scale_scale));
|
||||
if (self->node && scale != 1.0)
|
||||
if (self->node && scale != 0.)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
|
||||
node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
|
||||
gsk_render_node_unref (self->node);
|
||||
self->node = node;
|
||||
scale = pow (2., scale);
|
||||
big_node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
|
||||
}
|
||||
else if (self->node)
|
||||
{
|
||||
big_node = gsk_render_node_ref (self->node);
|
||||
}
|
||||
else
|
||||
{
|
||||
big_node = NULL;
|
||||
}
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
@@ -204,18 +210,27 @@ text_changed (GtkTextBuffer *buffer,
|
||||
graphene_rect_t bounds;
|
||||
guint i;
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
gsk_render_node_get_bounds (big_node, &bounds);
|
||||
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- bounds.origin.x, - bounds.origin.y));
|
||||
gtk_snapshot_append_node (snapshot, big_node);
|
||||
paintable = gtk_snapshot_free_to_paintable (snapshot, &bounds.size);
|
||||
gtk_picture_set_paintable (GTK_PICTURE (self->picture), paintable);
|
||||
g_clear_object (&paintable);
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
gsk_render_node_get_bounds (self->node, &bounds);
|
||||
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- bounds.origin.x, - bounds.origin.y));
|
||||
gtk_snapshot_append_node (snapshot, self->node);
|
||||
paintable = gtk_snapshot_free_to_paintable (snapshot, &bounds.size);
|
||||
gtk_picture_set_paintable (GTK_PICTURE (self->picture), paintable);
|
||||
|
||||
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i++)
|
||||
{
|
||||
gpointer item = g_list_model_get_item (G_LIST_MODEL (self->renderers), i);
|
||||
gtk_renderer_paintable_set_paintable (item, paintable);
|
||||
g_object_unref (item);
|
||||
}
|
||||
|
||||
g_clear_object (&paintable);
|
||||
}
|
||||
else
|
||||
@@ -223,6 +238,8 @@ text_changed (GtkTextBuffer *buffer,
|
||||
gtk_picture_set_paintable (GTK_PICTURE (self->picture), NULL);
|
||||
}
|
||||
|
||||
g_clear_pointer (&big_node, gsk_render_node_unref);
|
||||
|
||||
gtk_text_buffer_get_start_iter (self->text_buffer, &iter);
|
||||
|
||||
while (!gtk_text_iter_is_end (&iter))
|
||||
@@ -1292,6 +1309,13 @@ node_editor_window_init (NodeEditorWindow *self)
|
||||
" }\n"
|
||||
" transform: translate(0, 140);\n"
|
||||
"}", -1);
|
||||
|
||||
if (g_getenv ("GSK_RENDERER"))
|
||||
{
|
||||
char *new_title = g_strdup_printf ("GTK Node Editor - %s", g_getenv ("GSK_RENDERER"));
|
||||
gtk_window_set_title (GTK_WINDOW (self), new_title);
|
||||
g_free (new_title);
|
||||
}
|
||||
}
|
||||
|
||||
NodeEditorWindow *
|
||||
|
||||
@@ -163,9 +163,9 @@
|
||||
<property name="valign">center</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="value">1</property>
|
||||
<property name="upper">10</property>
|
||||
<property name="lower">-4</property>
|
||||
<property name="value">0</property>
|
||||
<property name="upper">4</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">0.5</property>
|
||||
</object>
|
||||
|
||||
@@ -220,6 +220,6 @@ clipboard.cut, clipboard.copy, clipboard.paste
|
||||
selection.delete, selection.select-all
|
||||
: Selection operations on entries, text view and labels
|
||||
|
||||
color.select, color.customize:
|
||||
color.select, color.customize
|
||||
: Operate on colors in a `GtkColorChooserWidget`. These actions are
|
||||
unusual in that they have the non-trivial parameter type (dddd):
|
||||
unusual in that they have the non-trivial parameter type (dddd).
|
||||
|
||||
@@ -6,22 +6,15 @@ Slug: broadway
|
||||
The GDK Broadway backend provides support for displaying GTK applications in
|
||||
a web browser, using HTML5 and web sockets.
|
||||
|
||||
To run your application in this way, select the Broadway backend by setting
|
||||
`GDK_BACKEND=broadway`. Then you can make your application appear in a web
|
||||
browser by pointing it at `http://127.0.0.1:8080`. Note that you need to
|
||||
enable web sockets in your web browser.
|
||||
|
||||
You can choose a different port from the default 8080 by setting the
|
||||
`BROADWAY_DISPLAY` environment variable to the port that you want to use.
|
||||
|
||||
It is also possible to use multiple GTK applications in the same web browser
|
||||
window, by using the Broadway server, `gtk4-broadwayd`, that ships with GTK.
|
||||
To start the Broadway server use:
|
||||
To run your application in this way, first run the broadway server,
|
||||
`gtk-broadwayd`, that ships with GTK:
|
||||
|
||||
```
|
||||
gtk4-broadwayd :5
|
||||
```
|
||||
|
||||
The server expects the colon-prefixed display number as a commandline argument.
|
||||
|
||||
Then point your web browser at `http://127.0.0.1:8085`.
|
||||
|
||||
Once the Broadway server is running, you can start your applications like
|
||||
@@ -31,6 +24,8 @@ this:
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
|
||||
```
|
||||
|
||||
Multiple applications can be presented in the same web browser window.
|
||||
|
||||
## Broadway-specific environment variables
|
||||
|
||||
### `BROADWAY_DISPLAY`
|
||||
|
||||
@@ -68,7 +68,7 @@ in a selector, widget names must be prefixed with a # character.
|
||||
| E:focus-within | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#focus-within-pseudo) | Set on all ancestors of the focus widget, unlike CSS |
|
||||
| E:focus-visible | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#focus-within-pseudo) | Set on focus widget and all ancestors, unlike CSS |
|
||||
| E:disabled | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_INSENSITIVE |
|
||||
| E:disabled | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_CHECKED |
|
||||
| E:checked | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#UIstates) | Corresponds to GTK_STATE_FLAG_CHECKED |
|
||||
| E:indeterminate | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#indeterminate) | Corresponds to GTK_STATE_FLAG_INCONSISTENT |
|
||||
| E:backdrop, E:selected | | Corresponds to GTK_STATE_FLAG_BACKDROP, GTK_STATE_FLAG_SELECTED |
|
||||
| E:not(selector) | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#negation) | |
|
||||
|
||||
@@ -103,14 +103,15 @@ fields, but e.g. buttons can take the focus too.
|
||||
|
||||
Input widgets can be given the focus by clicking on them, but focus
|
||||
can also be moved around with certain key events (this is known as
|
||||
“keyboard navigation”). GTK reserves the Tab key to move the focus
|
||||
to the next location, and Shift-Tab to move it back to the previous
|
||||
one. In addition many containers allow “directional navigation” with
|
||||
the arrow keys.
|
||||
“keyboard navigation”).
|
||||
GTK reserves the <kbd>Tab</kbd> key to move the focus to the next location,
|
||||
and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move it back to the previous one.
|
||||
In addition many containers allow “directional navigation” with the arrow keys.
|
||||
|
||||
Many widgets can be “activated” to trigger and action. E.g., you can
|
||||
activate a button or switch by clicking on them, but you can also
|
||||
activate them with the keyboard, by using the Enter or Space keys.
|
||||
Many widgets can be “activated” to trigger and action.
|
||||
E.g., you can activate a button or switch by clicking on them,
|
||||
but you can also activate them with the keyboard,
|
||||
by using the <kbd>Enter</kbd> or <kbd>Space</kbd> keys.
|
||||
|
||||
Apart from keyboard navigation, activation and directly typing into
|
||||
entries or text views, GTK widgets can use key events for activating
|
||||
@@ -121,15 +122,17 @@ GTK has traditionally supported different kinds of shortcuts:
|
||||
|
||||
- Accelerators are any other shortcuts that can be activated regardless
|
||||
of where the focus is, and typically trigger global actions, such as
|
||||
Ctrl-Q to quit an application.
|
||||
- Mnemonics are usually triggered using Alt as a modifier for a letter.
|
||||
<kbd>Ctrl</kbd>+<kbd>Q</kbd> to quit an application.
|
||||
- Mnemonics are usually triggered using <kbd>Alt</kbd>
|
||||
as a modifier for a letter.
|
||||
They are used in places where a label is associated with a control,
|
||||
and are indicated by underlining the letter in the label. As a special
|
||||
case, inside menus (i.e. inside `GtkPopoverMenu`), mnemonics can be
|
||||
triggered without the modifier.
|
||||
- Key bindings are specific to individual widgets, such as Ctrl-C or
|
||||
Ctrl-V in an entry copy to or paste from the clipboard. They are only
|
||||
triggered when the widget has focus.
|
||||
- Key bindings are specific to individual widgets,
|
||||
such as <kbd>Ctrl</kbd>+<kbd>C</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd>
|
||||
in an entry copy to or paste from the clipboard.
|
||||
They are only triggered when the widget has focus.
|
||||
|
||||
GTK handles accelerators and mnemonics in a global scope, during the
|
||||
capture phase, and key bindings locally, during the target phase.
|
||||
@@ -208,4 +211,4 @@ sequence, so setting the state on one does transfer the state to
|
||||
the others. They also are mutually exclusive, within a widget
|
||||
where may be only one gesture group claiming a given sequence.
|
||||
If another gesture group claims later that same sequence, the
|
||||
first group will deny the sequence:
|
||||
first group will deny the sequence.
|
||||
|
||||
@@ -263,10 +263,13 @@ the question you have, this list is a good place to start.
|
||||
* How do I load an image or animation from a file?
|
||||
|
||||
To load an image file straight into a display widget, use
|
||||
[ctor@Gtk.Picture.new_for_file] or [ctor@GTk.Picture.new_for_filename].
|
||||
[ctor@Gtk.Picture.new_for_file] or [ctor@Gtk.Picture.new_for_filename].
|
||||
To load an image for another purpose, use [ctor@Gdk.Texture.new_from_file].
|
||||
To load a video from a file, use [ctor@Gtk.MediaFile.new_for_file].
|
||||
|
||||
Note that [class@Gtk.Image] is meant for fixed-size icons. For arbitrary
|
||||
image files, you should use [class@Gtk.Picture].
|
||||
|
||||
* How do I draw text?
|
||||
|
||||
If you just want to put text into your user interface somewhere, it is
|
||||
@@ -283,8 +286,8 @@ the question you have, this list is a good place to start.
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
|
||||
See also the [Cairo Rendering](https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html)
|
||||
section of the [Pango documentation](https://developer.gnome.org/pango/stable/).
|
||||
See also the [Cairo Rendering](https://docs.gtk.org/PangoCairo/pango_cairo.html)
|
||||
section of the [Pango documentation](https://docs.gtk.org/Pango/).
|
||||
|
||||
To draw a piece of text in a widget [vfunc@Gtk.Widget.snapshot] implementation,
|
||||
use [method@Gtk.Snapshot.append_layout].
|
||||
@@ -301,8 +304,8 @@ the question you have, this list is a good place to start.
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
|
||||
See also the [Layout Objects](https://developer.gnome.org/pango/stable/pango-Layout-Objects.html)
|
||||
section of the [Pango documentation](https://developer.gnome.org/pango/stable/).
|
||||
See also the [Layout Objects](https://docs.gtk.org/Pango/class.Layout.html)
|
||||
section of the [Pango documentation](https://docs.gtk.org/Pango/).
|
||||
|
||||
* Why are types not registered if I use their `GTK_TYPE_BLAH` macro?
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
A trivial example
|
||||
=================
|
||||
|
||||
This is a very minimal example of an app that can be built against GTK.
|
||||
We use this in CI to test that building against the installed GTK works.
|
||||
|
||||
That is why there is a standalone meson.build in this subdirectory.
|
||||
@@ -1574,7 +1574,8 @@ broadway_server_query_mouse (BroadwayServer *server,
|
||||
|
||||
void
|
||||
broadway_server_destroy_surface (BroadwayServer *server,
|
||||
int id)
|
||||
int id,
|
||||
gboolean disconnected)
|
||||
{
|
||||
BroadwaySurface *surface;
|
||||
gint32 transient_for = -1;
|
||||
@@ -1589,8 +1590,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
|
||||
server->pointer_grab_surface_id = -1;
|
||||
|
||||
if (server->output)
|
||||
broadway_output_destroy_surface (server->output,
|
||||
id);
|
||||
broadway_output_destroy_surface (server->output, id);
|
||||
|
||||
surface = broadway_server_lookup_surface (server, id);
|
||||
if (surface != NULL)
|
||||
@@ -1604,7 +1604,7 @@ broadway_server_destroy_surface (BroadwayServer *server,
|
||||
broadway_surface_free (server, surface);
|
||||
}
|
||||
|
||||
if (transient_for != -1)
|
||||
if (transient_for != -1 && !disconnected)
|
||||
{
|
||||
surface = broadway_server_lookup_surface (server, transient_for);
|
||||
if (surface != NULL)
|
||||
|
||||
@@ -93,7 +93,8 @@ guint32 broadway_server_new_surface (BroadwayServer *
|
||||
int width,
|
||||
int height);
|
||||
void broadway_server_destroy_surface (BroadwayServer *server,
|
||||
int id);
|
||||
int id,
|
||||
gboolean disconnected);
|
||||
gboolean broadway_server_surface_show (BroadwayServer *server,
|
||||
int id);
|
||||
gboolean broadway_server_surface_hide (BroadwayServer *server,
|
||||
|
||||
@@ -101,8 +101,7 @@ client_disconnected (BroadwayClient *client)
|
||||
}
|
||||
|
||||
for (l = client->surfaces; l != NULL; l = l->next)
|
||||
broadway_server_destroy_surface (server,
|
||||
GPOINTER_TO_UINT (l->data));
|
||||
broadway_server_destroy_surface (server, GPOINTER_TO_UINT (l->data), TRUE);
|
||||
g_list_free (client->surfaces);
|
||||
client->surfaces = NULL;
|
||||
|
||||
@@ -268,7 +267,7 @@ client_handle_request (BroadwayClient *client,
|
||||
client->surfaces =
|
||||
g_list_remove (client->surfaces,
|
||||
GUINT_TO_POINTER (request->destroy_surface.id));
|
||||
broadway_server_destroy_surface (server, request->destroy_surface.id);
|
||||
broadway_server_destroy_surface (server, request->destroy_surface.id, FALSE);
|
||||
break;
|
||||
case BROADWAY_REQUEST_SHOW_SURFACE:
|
||||
broadway_server_surface_show (server, request->show_surface.id);
|
||||
|
||||
@@ -60,7 +60,11 @@ GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
|
||||
void gdk_display_set_debug_flags (GdkDisplay *display,
|
||||
GdkDebugFlags flags);
|
||||
|
||||
#ifdef GLIB_USING_SYSTEM_PRINTF
|
||||
#define gdk_debug_message(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
|
||||
#else
|
||||
#define gdk_debug_message(format, ...) g_fprintf (stderr, format "\n", ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
|
||||
@@ -1723,8 +1723,6 @@ gdk_display_init_egl (GdkDisplay *self,
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_no_config_context");
|
||||
self->have_egl_pixel_format_float =
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_pixel_format_float");
|
||||
self->have_egl_win32_libangle =
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_ANGLE_d3d_share_handle_client_buffer");
|
||||
|
||||
if (self->have_egl_no_config_context)
|
||||
priv->egl_config_high_depth = gdk_display_create_egl_config (self,
|
||||
|
||||
+15
-2
@@ -410,12 +410,19 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
|
||||
{
|
||||
const char *backend = backends[i];
|
||||
gboolean any = g_str_equal (backend, "*");
|
||||
gboolean found = FALSE;
|
||||
|
||||
if (!allow_any && !any && !strstr (allowed_backends, backend))
|
||||
continue;
|
||||
{
|
||||
GDK_DEBUG (MISC, "Skipping %s backend", backend);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; gdk_backends[j].name != NULL; j++)
|
||||
{
|
||||
if (g_str_equal (backend, gdk_backends[j].name))
|
||||
found = TRUE;
|
||||
|
||||
if ((any && allow_any) ||
|
||||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
|
||||
g_str_equal (backend, gdk_backends[j].name))
|
||||
@@ -423,9 +430,15 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
|
||||
GDK_DEBUG (MISC, "Trying %s backend", gdk_backends[j].name);
|
||||
display = gdk_backends[j].open_display (name);
|
||||
if (display)
|
||||
break;
|
||||
{
|
||||
GDK_DEBUG (MISC, "Using %s display %s", gdk_backends[j].name, gdk_display_get_name (display));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && !display)
|
||||
g_warning ("No such backend: %s", backend);
|
||||
}
|
||||
|
||||
g_strfreev (backends);
|
||||
|
||||
@@ -109,7 +109,6 @@ struct _GdkDisplay
|
||||
guint have_egl_buffer_age : 1;
|
||||
guint have_egl_no_config_context : 1;
|
||||
guint have_egl_pixel_format_float : 1;
|
||||
guint have_egl_win32_libangle : 1;
|
||||
};
|
||||
|
||||
struct _GdkDisplayClass
|
||||
|
||||
@@ -371,6 +371,12 @@ gdk_draw_context_begin_frame_full (GdkDrawContext *context,
|
||||
priv->surface->paint_context = g_object_ref (context);
|
||||
|
||||
GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, prefers_high_depth, priv->frame_region);
|
||||
|
||||
cairo_region_intersect_rectangle (priv->frame_region,
|
||||
&(cairo_rectangle_int_t) {
|
||||
0, 0,
|
||||
priv->surface->width, priv->surface->height
|
||||
});
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYSPROF
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@
|
||||
* for the synchronization being implemented, the clock will process a frame and
|
||||
* emit signals for each phase that has been requested. (See the signals of the
|
||||
* `GdkFrameClock` class for documentation of the phases.
|
||||
* %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@GdkFrameClock::update] signal
|
||||
* %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@Gdk.FrameClock::update] signal
|
||||
* are most interesting for application writers, and are used to update the
|
||||
* animations, using the frame time given by [method@Gdk.FrameClock.get_frame_time].
|
||||
*
|
||||
@@ -60,7 +60,7 @@
|
||||
* are called at a “similar” time get the same value. This means that
|
||||
* if different animations are timed by looking at the difference in
|
||||
* time between an initial value from [method@Gdk.FrameClock.get_frame_time]
|
||||
* and the value inside the [signal@GdkFrameClock::update] signal of the clock,
|
||||
* and the value inside the [signal@Gdk.FrameClock::update] signal of the clock,
|
||||
* they will stay exactly synchronized.
|
||||
*/
|
||||
|
||||
|
||||
+2
-12
@@ -295,7 +295,6 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
|
||||
/* We will use the default version matching the context status
|
||||
* unless the user requested a version which makes sense */
|
||||
gdk_gl_context_get_matching_version (api, legacy,
|
||||
display->have_egl_win32_libangle,
|
||||
&min_major, &min_minor);
|
||||
gdk_gl_context_get_clipped_version (context,
|
||||
min_major, min_minor,
|
||||
@@ -968,7 +967,6 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
|
||||
void
|
||||
gdk_gl_context_get_matching_version (GdkGLAPI api,
|
||||
gboolean legacy,
|
||||
gboolean win32_libangle,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
@@ -989,16 +987,8 @@ gdk_gl_context_get_matching_version (GdkGLAPI api,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (win32_libangle)
|
||||
{
|
||||
maj = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GLES_VERSION_MINOR;
|
||||
}
|
||||
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GLES_VERSION_MINOR;
|
||||
}
|
||||
|
||||
if (major != NULL)
|
||||
|
||||
@@ -37,8 +37,7 @@ G_BEGIN_DECLS
|
||||
* Backends should make sure to never create a context of a previous version.
|
||||
*
|
||||
* The macros refer to OpenGL; OpenGL with OPENGL_COMPATIBILITY_PROFILE_BIT as
|
||||
* OPENGL_PROFILE_MASK; OpenGL ES; and OpenGL ES win32 Angle implementation,
|
||||
* respectively
|
||||
* OPENGL_PROFILE_MASK; and OpenGL ES respectively
|
||||
*/
|
||||
#define GDK_GL_MIN_GL_VERSION_MAJOR (3)
|
||||
#define GDK_GL_MIN_GL_VERSION_MINOR (2)
|
||||
@@ -46,8 +45,6 @@ G_BEGIN_DECLS
|
||||
#define GDK_GL_MIN_GL_LEGACY_VERSION_MINOR (0)
|
||||
#define GDK_GL_MIN_GLES_VERSION_MAJOR (2)
|
||||
#define GDK_GL_MIN_GLES_VERSION_MINOR (0)
|
||||
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR (3)
|
||||
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR (0)
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_NONE = 0,
|
||||
@@ -101,7 +98,6 @@ typedef struct {
|
||||
} GdkGLContextProgram;
|
||||
|
||||
typedef struct {
|
||||
guint vertex_array_object;
|
||||
guint tmp_framebuffer;
|
||||
guint tmp_vertex_buffer;
|
||||
|
||||
@@ -141,7 +137,6 @@ void gdk_gl_context_get_clipped_version (GdkGLContext
|
||||
int *minor);
|
||||
void gdk_gl_context_get_matching_version (GdkGLAPI api,
|
||||
gboolean legacy,
|
||||
gboolean win32_libangle,
|
||||
int *major,
|
||||
int *minor);
|
||||
|
||||
|
||||
+5
-5
@@ -50,7 +50,7 @@ void gtk_snapshot_pop (GdkSnapshot
|
||||
* to do, it is suggested that you scale your paintable ignoring any potential
|
||||
* aspect ratio.
|
||||
*
|
||||
* The contents that a `GdkPaintable` produces may depend on the [class@GdkSnapshot]
|
||||
* The contents that a `GdkPaintable` produces may depend on the [class@Gdk.Snapshot]
|
||||
* passed to it. For example, paintables may decide to use more detailed images
|
||||
* on higher resolution screens or when OpenGL is available. A `GdkPaintable`
|
||||
* will however always produce the same output for the same snapshot.
|
||||
@@ -58,7 +58,7 @@ void gtk_snapshot_pop (GdkSnapshot
|
||||
* A `GdkPaintable` may change its contents, meaning that it will now produce
|
||||
* a different output with the same snapshot. Once that happens, it will call
|
||||
* [method@Gdk.Paintable.invalidate_contents] which will emit the
|
||||
* [signal@GdkPaintable::invalidate-contents] signal. If a paintable is known
|
||||
* [signal@Gdk.Paintable::invalidate-contents] signal. If a paintable is known
|
||||
* to never change its contents, it will set the %GDK_PAINTABLE_STATIC_CONTENTS
|
||||
* flag. If a consumer cannot deal with changing contents, it may call
|
||||
* [method@Gdk.Paintable.get_current_image] which will return a static
|
||||
@@ -69,7 +69,7 @@ void gtk_snapshot_pop (GdkSnapshot
|
||||
* can use this information to layout thepaintable appropriately. Just like the
|
||||
* contents, the size of a paintable can change. A paintable will indicate this
|
||||
* by calling [method@Gdk.Paintable.invalidate_size] which will emit the
|
||||
* [signal@GdkPaintable::invalidate-size] signal. And just like for contents,
|
||||
* [signal@Gdk.Paintable::invalidate-size] signal. And just like for contents,
|
||||
* if a paintable is known to never change its size, it will set the
|
||||
* %GDK_PAINTABLE_STATIC_SIZE flag.
|
||||
*
|
||||
@@ -529,7 +529,7 @@ gdk_paintable_compute_concrete_size (GdkPaintable *paintable,
|
||||
* the missing dimension is calculated from the present
|
||||
* dimension and the intrinsic aspect ratio.
|
||||
* Otherwise, the missing dimension is taken from the default
|
||||
* object size.
|
||||
* object size.
|
||||
*/
|
||||
if (image_width)
|
||||
*concrete_width = image_width;
|
||||
@@ -559,7 +559,7 @@ gdk_paintable_compute_concrete_size (GdkPaintable *paintable,
|
||||
* dimensions, the missing dimension is taken from the object's intrinsic
|
||||
* dimensions.
|
||||
* Otherwise, the missing dimension of the concrete object size is taken
|
||||
* from the default object size.
|
||||
* from the default object size.
|
||||
*/
|
||||
if (specified_width)
|
||||
{
|
||||
|
||||
+3
-3
@@ -37,10 +37,10 @@ G_DECLARE_INTERFACE (GdkPaintable, gdk_paintable, GDK, PAINTABLE, GObject)
|
||||
/**
|
||||
* GdkPaintableFlags:
|
||||
* @GDK_PAINTABLE_STATIC_SIZE: The size is immutable.
|
||||
* The [signal@GdkPaintable::invalidate-size] signal will never be
|
||||
* The [signal@Gdk.Paintable::invalidate-size] signal will never be
|
||||
* emitted.
|
||||
* @GDK_PAINTABLE_STATIC_CONTENTS: The content is immutable.
|
||||
* The [signal@GdkPaintable::invalidate-contents] signal will never be
|
||||
* The [signal@Gdk.Paintable::invalidate-contents] signal will never be
|
||||
* emitted.
|
||||
*
|
||||
* Flags about a paintable object.
|
||||
@@ -97,7 +97,7 @@ struct _GdkPaintableInterface
|
||||
double height);
|
||||
/* get the current contents in an immutable form (optional) */
|
||||
GdkPaintable * (* get_current_image) (GdkPaintable *paintable);
|
||||
|
||||
|
||||
/* get flags for potential optimizations (optional) */
|
||||
GdkPaintableFlags (* get_flags) (GdkPaintable *paintable);
|
||||
/* preferred width of paintable or 0 if it has no width (optional) */
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@
|
||||
* The `GdkPopup` is positioned relative to its parent surface.
|
||||
*
|
||||
* `GdkPopup`s are typically used to implement menus and similar popups.
|
||||
* They can be modal, which is indicated by the [property@GdkPopup:autohide]
|
||||
* They can be modal, which is indicated by the [property@Gdk.Popup:autohide]
|
||||
* property.
|
||||
*/
|
||||
|
||||
@@ -113,7 +113,7 @@ gdk_popup_default_init (GdkPopupInterface *iface)
|
||||
* otherwise it will change position according to @layout.
|
||||
*
|
||||
* After calling this function, the result should be handled in response
|
||||
* to the [signal@GdkSurface::layout] signal being emitted. The resulting
|
||||
* to the [signal@Gdk.Surface::layout] signal being emitted. The resulting
|
||||
* popup position can be queried using [method@Gdk.Popup.get_position_x],
|
||||
* [method@Gdk.Popup.get_position_y], and the resulting size will be sent as
|
||||
* parameters in the layout signal. Use [method@Gdk.Popup.get_rect_anchor]
|
||||
|
||||
+3
-1
@@ -165,7 +165,7 @@ parse_rgb_value (const char *str,
|
||||
*
|
||||
* The string can be either one of:
|
||||
*
|
||||
* - A standard name (Taken from the Css specification).
|
||||
* - A standard name (Taken from the CSS specification).
|
||||
* - A hexadecimal value in the form “\#rgb”, “\#rrggbb”,
|
||||
* “\#rrrgggbbb” or ”\#rrrrggggbbbb”
|
||||
* - A hexadecimal value in the form “\#rgba”, “\#rrggbbaa”,
|
||||
@@ -173,6 +173,8 @@ parse_rgb_value (const char *str,
|
||||
* - A RGB color in the form “rgb(r,g,b)” (In this case the color
|
||||
* will have full opacity)
|
||||
* - A RGBA color in the form “rgba(r,g,b,a)”
|
||||
* - A HSL color in the form "hsl(hue, saturation, lightness)"
|
||||
* - A HSLA color in the form "hsla(hue, saturation, lightness, alpha)"
|
||||
*
|
||||
* Where “r”, “g”, “b” and “a” are respectively the red, green,
|
||||
* blue and alpha color values. In the last two cases, “r”, “g”,
|
||||
|
||||
+3
-1
@@ -1081,8 +1081,10 @@ gdk_surface_set_egl_native_window (GdkSurface *self,
|
||||
|
||||
if (priv->egl_surface != NULL)
|
||||
{
|
||||
GdkDisplay *display = gdk_surface_get_display (self);
|
||||
|
||||
gdk_gl_context_clear_current_if_surface (self);
|
||||
eglDestroySurface (gdk_surface_get_display (self), priv->egl_surface);
|
||||
eglDestroySurface (gdk_display_get_egl_display (display), priv->egl_surface);
|
||||
priv->egl_surface = NULL;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -395,7 +395,7 @@ gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf)
|
||||
|
||||
bytes = g_bytes_new_with_free_func (gdk_pixbuf_get_pixels (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf)
|
||||
* gdk_pixbuf_get_rowstride (pixbuf),
|
||||
* (gsize) gdk_pixbuf_get_rowstride (pixbuf),
|
||||
g_object_unref,
|
||||
g_object_ref (pixbuf));
|
||||
texture = gdk_memory_texture_new (gdk_pixbuf_get_width (pixbuf),
|
||||
|
||||
+6
-5
@@ -261,15 +261,16 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
/**
|
||||
* GdkToplevel::compute-size:
|
||||
* @toplevel: a `GdkToplevel`
|
||||
* @size: (type Gdk.ToplevelSize) (out caller-allocates): a `GdkToplevelSize`
|
||||
* @size: (type Gdk.ToplevelSize): a `GdkToplevelSize`
|
||||
*
|
||||
* Emitted when the size for the surface needs to be computed, when
|
||||
* it is present.
|
||||
*
|
||||
* It will normally be emitted during or after [method@Gdk.Toplevel.present],
|
||||
* depending on the configuration received by the windowing system.
|
||||
* It may also be emitted at any other point in time, in response
|
||||
* to the windowing system spontaneously changing the configuration.
|
||||
* This signal will normally be emitted during or after a call to
|
||||
* [method@Gdk.Toplevel.present], depending on the configuration
|
||||
* received by the windowing system. It may also be emitted at any
|
||||
* other point in time, in response to the windowing system
|
||||
* spontaneously changing the configuration of the toplevel surface.
|
||||
*
|
||||
* It is the responsibility of the toplevel user to handle this signal
|
||||
* and compute the desired size of the toplevel, given the information
|
||||
|
||||
@@ -207,7 +207,7 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
|
||||
{
|
||||
char *path;
|
||||
XcursorImages *images;
|
||||
struct cursor *cursor;
|
||||
struct wl_cursor *cursor;
|
||||
struct cursor_image *image;
|
||||
int i, nbytes;
|
||||
unsigned int load_size;
|
||||
@@ -240,17 +240,16 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->cursor.images =
|
||||
malloc(images->nimage * sizeof cursor->cursor.images[0]);
|
||||
if (!cursor->cursor.images) {
|
||||
cursor->images =
|
||||
malloc(images->nimage * sizeof cursor->images[0]);
|
||||
if (!cursor->images) {
|
||||
free(cursor);
|
||||
xcursor_images_destroy (images);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->cursor.name = strdup(name);
|
||||
cursor->cursor.size = load_size;
|
||||
cursor->total_delay = 0;
|
||||
cursor->name = strdup(name);
|
||||
cursor->size = load_size;
|
||||
|
||||
for (i = 0; i < images->nimage; i++) {
|
||||
image = malloc(sizeof *image);
|
||||
@@ -291,14 +290,13 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
|
||||
}
|
||||
}
|
||||
}
|
||||
cursor->total_delay += image->image.delay;
|
||||
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
|
||||
cursor->images[i] = (struct wl_cursor_image *) image;
|
||||
}
|
||||
cursor->cursor.image_count = i;
|
||||
cursor->image_count = i;
|
||||
|
||||
if (cursor->cursor.image_count == 0) {
|
||||
free(cursor->cursor.name);
|
||||
free(cursor->cursor.images);
|
||||
if (cursor->image_count == 0) {
|
||||
free(cursor->name);
|
||||
free(cursor->images);
|
||||
free(cursor);
|
||||
xcursor_images_destroy (images);
|
||||
return NULL;
|
||||
@@ -306,7 +304,7 @@ wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
|
||||
|
||||
xcursor_images_destroy (images);
|
||||
|
||||
return &cursor->cursor;
|
||||
return cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -586,13 +586,6 @@ _gdk_wayland_display_open (const char *display_name)
|
||||
|
||||
GDK_DEBUG (MISC, "opening display %s", display_name ? display_name : "");
|
||||
|
||||
/* If this variable is unset then wayland initialisation will surely
|
||||
* fail, logging a fatal error in the process. Save ourselves from
|
||||
* that.
|
||||
*/
|
||||
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
|
||||
return NULL;
|
||||
|
||||
wl_log_set_handler_client (log_handler);
|
||||
|
||||
wl_display = wl_display_connect (display_name);
|
||||
@@ -1082,6 +1075,9 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
g_assert (display_wayland);
|
||||
g_assert (display_wayland->shm);
|
||||
|
||||
if (size == 0)
|
||||
size = 24;
|
||||
|
||||
if (g_strcmp0 (name, display_wayland->cursor_theme_name) == 0 &&
|
||||
display_wayland->cursor_theme_size == size)
|
||||
return;
|
||||
|
||||
@@ -65,6 +65,9 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
|
||||
int dx = impl->pending_buffer_offset_x;
|
||||
int dy = impl->pending_buffer_offset_y;
|
||||
|
||||
impl->pending_buffer_offset_x = 0;
|
||||
impl->pending_buffer_offset_y = 0;
|
||||
|
||||
gdk_wayland_surface_sync (surface);
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
@@ -118,7 +121,7 @@ gdk_wayland_display_init_gl (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandDisplay *self = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
if (!gdk_display_init_egl (display,
|
||||
if (!gdk_display_init_egl (display,
|
||||
EGL_PLATFORM_WAYLAND_EXT,
|
||||
self->wl_display,
|
||||
TRUE,
|
||||
|
||||
@@ -398,7 +398,11 @@ gdk_wayland_popup_handle_configure (GdkWaylandSurface *wayland_surface)
|
||||
g_warn_if_reached ();
|
||||
|
||||
if (wayland_popup->pending.has_repositioned_token)
|
||||
wayland_popup->received_reposition_token = wayland_popup->pending.repositioned_token;
|
||||
{
|
||||
wayland_popup->received_reposition_token =
|
||||
wayland_popup->pending.repositioned_token;
|
||||
wayland_popup->pending.has_repositioned_token = FALSE;
|
||||
}
|
||||
|
||||
switch (wayland_popup->state)
|
||||
{
|
||||
@@ -743,9 +747,7 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
|
||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
GdkRectangle geometry;
|
||||
uint32_t constraint_adjustment = ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE;
|
||||
const GdkRectangle *anchor_rect;
|
||||
int real_anchor_rect_x, real_anchor_rect_y;
|
||||
int anchor_rect_width, anchor_rect_height;
|
||||
GdkRectangle anchor_rect;
|
||||
int rect_anchor_dx;
|
||||
int rect_anchor_dy;
|
||||
GdkGravity rect_anchor;
|
||||
@@ -771,12 +773,24 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
|
||||
|
||||
gdk_wayland_surface_get_window_geometry (surface->parent, &parent_geometry);
|
||||
|
||||
anchor_rect = gdk_popup_layout_get_anchor_rect (layout);
|
||||
real_anchor_rect_x = anchor_rect->x - parent_geometry.x;
|
||||
real_anchor_rect_y = anchor_rect->y - parent_geometry.y;
|
||||
anchor_rect = *gdk_popup_layout_get_anchor_rect (layout);
|
||||
|
||||
anchor_rect_width = MAX (anchor_rect->width, 1);
|
||||
anchor_rect_height = MAX (anchor_rect->height, 1);
|
||||
/* Wayland protocol requires that the anchor rect is specified
|
||||
* wrt. to the parent geometry, and that it is non-empty and
|
||||
* contained in the parent geometry.
|
||||
*/
|
||||
if (!gdk_rectangle_intersect (&parent_geometry, &anchor_rect, &anchor_rect))
|
||||
{
|
||||
anchor_rect.x = 0;
|
||||
anchor_rect.y = 0;
|
||||
anchor_rect.width = 1;
|
||||
anchor_rect.height = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
anchor_rect.x -= parent_geometry.x;
|
||||
anchor_rect.y -= parent_geometry.y;
|
||||
}
|
||||
|
||||
gdk_popup_layout_get_offset (layout, &rect_anchor_dx, &rect_anchor_dy);
|
||||
|
||||
@@ -797,10 +811,10 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
|
||||
|
||||
xdg_positioner_set_size (positioner, geometry.width, geometry.height);
|
||||
xdg_positioner_set_anchor_rect (positioner,
|
||||
real_anchor_rect_x,
|
||||
real_anchor_rect_y,
|
||||
anchor_rect_width,
|
||||
anchor_rect_height);
|
||||
anchor_rect.x,
|
||||
anchor_rect.y,
|
||||
anchor_rect.width,
|
||||
anchor_rect.height);
|
||||
xdg_positioner_set_offset (positioner, rect_anchor_dx, rect_anchor_dy);
|
||||
|
||||
anchor = rect_anchor_to_anchor (rect_anchor);
|
||||
@@ -851,10 +865,10 @@ create_dynamic_positioner (GdkWaylandPopup *wayland_popup,
|
||||
|
||||
zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height);
|
||||
zxdg_positioner_v6_set_anchor_rect (positioner,
|
||||
real_anchor_rect_x,
|
||||
real_anchor_rect_y,
|
||||
anchor_rect_width,
|
||||
anchor_rect_height);
|
||||
anchor_rect.x,
|
||||
anchor_rect.y,
|
||||
anchor_rect.width,
|
||||
anchor_rect.height);
|
||||
zxdg_positioner_v6_set_offset (positioner,
|
||||
rect_anchor_dx,
|
||||
rect_anchor_dy);
|
||||
@@ -968,6 +982,9 @@ gdk_wayland_surface_create_xdg_popup (GdkWaylandPopup *wayland_popup,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
wayland_popup->received_reposition_token = 0;
|
||||
wayland_popup->reposition_token = 0;
|
||||
|
||||
gdk_popup_layout_get_shadow_width (layout,
|
||||
&impl->shadow_left,
|
||||
&impl->shadow_right,
|
||||
|
||||
@@ -99,7 +99,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
|
||||
|
||||
if (cb->source)
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring clipboard offer for self", cb);
|
||||
GDK_DISPLAY_DEBUG (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, "%p: Ignoring primary offer for self", cb);
|
||||
gdk_content_formats_unref (formats);
|
||||
g_clear_pointer (&offer, zwp_primary_selection_offer_v1_destroy);
|
||||
return;
|
||||
@@ -111,7 +111,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
|
||||
{
|
||||
char *s = gdk_content_formats_to_string (formats);
|
||||
gdk_debug_message ("%p: remote clipboard claim for %s", cb, s);
|
||||
gdk_debug_message ("%p: remote primary claim for %s", cb, s);
|
||||
g_free (s);
|
||||
}
|
||||
#endif
|
||||
@@ -119,8 +119,7 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
|
||||
cb->offer_formats = formats;
|
||||
cb->offer = offer;
|
||||
|
||||
gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb),
|
||||
cb->offer_formats);
|
||||
gdk_clipboard_claim_remote (GDK_CLIPBOARD (cb), cb->offer_formats);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -271,6 +270,14 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
|
||||
{
|
||||
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (clipboard);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (clipboard), CLIPBOARD))
|
||||
{
|
||||
char *s = gdk_content_formats_to_string (formats);
|
||||
gdk_debug_message ("%p: claim primary (%s) for %s", cb, local ? "local" : "remote", s);
|
||||
g_free (s);
|
||||
}
|
||||
#endif
|
||||
if (local)
|
||||
{
|
||||
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));
|
||||
|
||||
@@ -520,8 +520,6 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
|
||||
surface->width = width;
|
||||
surface->height = height;
|
||||
|
||||
g_object_ref (surface);
|
||||
|
||||
/* More likely to be right than just assuming 1 */
|
||||
if (display_wayland->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
@@ -632,7 +630,7 @@ gdk_wayland_surface_dispose (GObject *object)
|
||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
|
||||
display_wayland->event_queues =
|
||||
g_list_remove (display_wayland->event_queues, surface);
|
||||
g_list_remove (display_wayland->event_queues, impl->event_queue);
|
||||
g_clear_pointer (&impl->event_queue, wl_event_queue_destroy);
|
||||
}
|
||||
|
||||
|
||||
@@ -991,7 +991,7 @@ gdk_wayland_toplevel_set_startup_id (GdkWaylandToplevel *toplevel,
|
||||
startup_id = free_me;
|
||||
}
|
||||
|
||||
if (startup_id)
|
||||
if (display->xdg_activation && startup_id)
|
||||
xdg_activation_v1_activate (display->xdg_activation,
|
||||
startup_id,
|
||||
surface->display_server.wl_surface);
|
||||
|
||||
@@ -1005,7 +1005,8 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
} bmi;
|
||||
HDC hdc;
|
||||
uint8_t *pixels, *bits;
|
||||
int rowstride, x, y, w, h;
|
||||
int x, y, w, h;
|
||||
gsize rowstride;
|
||||
|
||||
if (!GDI_CALL (GetIconInfo, (hicon, &ii)))
|
||||
return NULL;
|
||||
@@ -1057,7 +1058,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
no_alpha = FALSE;
|
||||
pixels += 4;
|
||||
}
|
||||
pixels += (w * 4 - rowstride);
|
||||
pixels += rowstride - w * 4;
|
||||
}
|
||||
|
||||
/* mask */
|
||||
@@ -1072,7 +1073,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
pixels[3] = 255 - bits[(x + y * w) * 4];
|
||||
pixels += 4;
|
||||
}
|
||||
pixels += (w * 4 - rowstride);
|
||||
pixels += rowstride - w * 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1146,7 +1147,7 @@ gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
|
||||
xorp++;
|
||||
}
|
||||
}
|
||||
pixels += (w * 4 - rowstride);
|
||||
pixels += rowstride - w * 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1207,6 +1207,7 @@ gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
{
|
||||
return g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL,
|
||||
"display", display,
|
||||
"allowed-apis", GDK_GL_API_GLES,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -83,20 +83,13 @@ gdk_win32_gl_context_egl_end_frame (GdkDrawContext *draw_context,
|
||||
cairo_region_t *painted)
|
||||
{
|
||||
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
|
||||
GdkWin32GLContextEGL *context_egl = GDK_WIN32_GL_CONTEXT_EGL (context);
|
||||
GdkSurface *surface = gdk_gl_context_get_surface (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
cairo_rectangle_int_t whole_window;
|
||||
EGLSurface egl_surface;
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->end_frame (draw_context, painted);
|
||||
|
||||
gdk_gl_context_make_current (context);
|
||||
whole_window =
|
||||
(GdkRectangle) { 0, 0,
|
||||
gdk_surface_get_width (surface),
|
||||
gdk_surface_get_height (surface)
|
||||
};
|
||||
|
||||
egl_surface = gdk_surface_get_egl_surface (surface);
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
*
|
||||
* gdkglcontext-win32-wgl-private.c: Win32 specific OpenGL wrappers
|
||||
*
|
||||
* Copyright © 2023 Chun-wei Fan
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These wrapper functions are used when we don't want to use the wgl*() core functions
|
||||
* that we acquire via libepoxy (such as when we are disposing the Gdk(W)GLContext from,
|
||||
* different threads, so for these calls, we are actually linking to the system's/ICD
|
||||
* opengl32.dll directly, so that we are guaranteed that the "right" versions of these
|
||||
* WGL calls are carried out. This must be a separate source file because we can't include
|
||||
* the system's GL/gl.h with epoxy/(w)gl.h together in a single source file. We should not
|
||||
* need to use these when we are creating/initializing a WGL context in GDK, since we should
|
||||
* be in the same thread at this point.
|
||||
*/
|
||||
|
||||
#define DONT_INCLUDE_LIBEPOXY
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
|
||||
#include "gdkglcontext-win32.h"
|
||||
|
||||
void
|
||||
gdk_win32_private_wglDeleteContext (HGLRC hglrc)
|
||||
{
|
||||
wglDeleteContext (hglrc);
|
||||
}
|
||||
|
||||
HGLRC
|
||||
gdk_win32_private_wglGetCurrentContext (void)
|
||||
{
|
||||
return wglGetCurrentContext ();
|
||||
}
|
||||
|
||||
BOOL
|
||||
gdk_win32_private_wglMakeCurrent (HDC hdc,
|
||||
HGLRC hglrc)
|
||||
{
|
||||
return wglMakeCurrent (hdc, hglrc);
|
||||
}
|
||||
@@ -60,12 +60,12 @@ gdk_win32_gl_context_wgl_dispose (GObject *gobject)
|
||||
|
||||
if (context_wgl->wgl_context != NULL)
|
||||
{
|
||||
if (wglGetCurrentContext () == context_wgl->wgl_context)
|
||||
wglMakeCurrent (NULL, NULL);
|
||||
if (gdk_win32_private_wglGetCurrentContext () == context_wgl->wgl_context)
|
||||
gdk_win32_private_wglMakeCurrent (NULL, NULL);
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("Destroying WGL context\n"));
|
||||
|
||||
wglDeleteContext (context_wgl->wgl_context);
|
||||
gdk_win32_private_wglDeleteContext (context_wgl->wgl_context);
|
||||
context_wgl->wgl_context = NULL;
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
|
||||
static gboolean
|
||||
gdk_win32_gl_context_wgl_clear_current (GdkGLContext *context)
|
||||
{
|
||||
return wglMakeCurrent (NULL, NULL);
|
||||
return gdk_win32_private_wglMakeCurrent (NULL, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -636,7 +636,7 @@ gdk_win32_gl_context_wgl_is_current (GdkGLContext *context)
|
||||
{
|
||||
GdkWin32GLContextWGL *self = GDK_WIN32_GL_CONTEXT_WGL (context);
|
||||
|
||||
return self->wgl_context == wglGetCurrentContext ();
|
||||
return self->wgl_context == gdk_win32_private_wglGetCurrentContext ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -654,7 +654,7 @@ gdk_win32_gl_context_wgl_make_current (GdkGLContext *context,
|
||||
else
|
||||
hdc = GDK_WIN32_SURFACE (surface)->hdc;
|
||||
|
||||
if (!wglMakeCurrent (hdc, context_wgl->wgl_context))
|
||||
if (!gdk_win32_private_wglMakeCurrent (hdc, context_wgl->wgl_context))
|
||||
return FALSE;
|
||||
|
||||
if (!surfaceless && display_win32->hasWglEXTSwapControl)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#ifndef __GDK_WIN32_GL_CONTEXT__
|
||||
#define __GDK_WIN32_GL_CONTEXT__
|
||||
|
||||
#ifndef DONT_INCLUDE_LIBEPOXY
|
||||
#include <epoxy/gl.h>
|
||||
#include <epoxy/wgl.h>
|
||||
|
||||
@@ -31,9 +32,18 @@
|
||||
#include "gdkglcontextprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdksurface.h"
|
||||
#else
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# include <GL/gl.h>
|
||||
|
||||
# include <glib.h>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifndef DONT_INCLUDE_LIBEPOXY
|
||||
|
||||
#define GDK_WIN32_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
|
||||
#define GDK_WIN32_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
|
||||
#define GDK_WIN32_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_GL_CONTEXT))
|
||||
@@ -78,6 +88,13 @@ GType gdk_win32_gl_context_egl_get_type (void) G_GNUC_CONST;
|
||||
void
|
||||
_gdk_win32_surface_invalidate_egl_framebuffer (GdkSurface *surface);
|
||||
|
||||
#endif /* !DONT_INCLUDE_LIBEPOXY */
|
||||
|
||||
HGLRC gdk_win32_private_wglGetCurrentContext (void);
|
||||
BOOL gdk_win32_private_wglMakeCurrent (HDC hdc,
|
||||
HGLRC hglrc);
|
||||
void gdk_win32_private_wglDeleteContext (HGLRC hglrc);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WIN32_GL_CONTEXT__ */
|
||||
|
||||
@@ -443,9 +443,6 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
|
||||
char *path, *path_lower;
|
||||
DISPLAYCONFIG_RATIONAL *refresh;
|
||||
|
||||
if ((dispconf_paths[path_index].flags & DISPLAYCONFIG_PATH_ACTIVE) == 0)
|
||||
continue;
|
||||
|
||||
tdn.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
|
||||
tdn.header.size = sizeof (tdn);
|
||||
tdn.header.adapterId = dispconf_paths[path_index].targetInfo.adapterId;
|
||||
@@ -481,6 +478,12 @@ populate_monitor_devices_from_display_config (GPtrArray *monitors)
|
||||
if (w32mon == NULL)
|
||||
continue;
|
||||
|
||||
if ((dispconf_paths[path_index].flags & DISPLAYCONFIG_PATH_ACTIVE) == 0)
|
||||
{
|
||||
w32mon->remove = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
mon = GDK_MONITOR (w32mon);
|
||||
|
||||
if (!tdn.flags.friendlyNameForced)
|
||||
|
||||
@@ -23,6 +23,7 @@ gdk_win32_sources = gdk_win32_public_sources + files([
|
||||
'gdkdevice-wintab.c',
|
||||
'gdkdrop-win32.c',
|
||||
'gdkglobals-win32.c',
|
||||
'gdkglcontext-win32-wgl-private.c',
|
||||
'gdkhdataoutputstream-win32.c',
|
||||
'gdkinput-dmanipulation.c',
|
||||
'gdkinput-winpointer.c',
|
||||
@@ -59,6 +60,7 @@ endif
|
||||
gdk_win32_deps = [
|
||||
pangowin32_dep, # FIXME
|
||||
cc.find_library('hid'),
|
||||
cc.find_library('opengl32'),
|
||||
]
|
||||
|
||||
libgdk_win32 = static_library('gdk-win32',
|
||||
|
||||
@@ -145,7 +145,8 @@ struct _GdkX11Display
|
||||
guint server_time_is_monotonic_time : 1;
|
||||
|
||||
/* GLX extensions we check */
|
||||
guint has_glx_swap_interval : 1;
|
||||
guint has_glx_sgi_swap_control : 1;
|
||||
guint has_glx_swap_control : 1;
|
||||
guint has_glx_create_context : 1;
|
||||
guint has_glx_texture_from_pixmap : 1;
|
||||
guint has_glx_video_sync : 1;
|
||||
|
||||
+1
-204
@@ -134,35 +134,6 @@ struct _GdkX11DragClass
|
||||
GdkDragClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int keysym;
|
||||
int modifiers;
|
||||
} GrabKey;
|
||||
|
||||
static GrabKey grab_keys[] = {
|
||||
{ XK_Escape, 0 },
|
||||
{ XK_space, 0 },
|
||||
{ XK_KP_Space, 0 },
|
||||
{ XK_Return, 0 },
|
||||
{ XK_KP_Enter, 0 },
|
||||
{ XK_Up, 0 },
|
||||
{ XK_Up, Mod1Mask },
|
||||
{ XK_Down, 0 },
|
||||
{ XK_Down, Mod1Mask },
|
||||
{ XK_Left, 0 },
|
||||
{ XK_Left, Mod1Mask },
|
||||
{ XK_Right, 0 },
|
||||
{ XK_Right, Mod1Mask },
|
||||
{ XK_KP_Up, 0 },
|
||||
{ XK_KP_Up, Mod1Mask },
|
||||
{ XK_KP_Down, 0 },
|
||||
{ XK_KP_Down, Mod1Mask },
|
||||
{ XK_KP_Left, 0 },
|
||||
{ XK_KP_Left, Mod1Mask },
|
||||
{ XK_KP_Right, 0 },
|
||||
{ XK_KP_Right, Mod1Mask }
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
static GdkSurfaceCache *gdk_surface_cache_ref (GdkSurfaceCache *cache);
|
||||
@@ -1899,20 +1870,15 @@ drag_grab (GdkDrag *drag)
|
||||
{
|
||||
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
|
||||
GdkSeatCapabilities capabilities;
|
||||
GdkDisplay *display;
|
||||
Window root;
|
||||
GdkSeat *seat;
|
||||
int keycode, i;
|
||||
GdkCursor *cursor;
|
||||
|
||||
if (!x11_drag->ipc_surface)
|
||||
return FALSE;
|
||||
|
||||
display = gdk_drag_get_display (drag);
|
||||
root = GDK_DISPLAY_XROOTWIN (display);
|
||||
seat = gdk_device_get_seat (gdk_drag_get_device (drag));
|
||||
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING | GDK_SEAT_CAPABILITY_KEYBOARD;
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
|
||||
|
||||
cursor = gdk_drag_get_cursor (drag, x11_drag->current_action);
|
||||
g_set_object (&x11_drag->cursor, cursor);
|
||||
@@ -1924,46 +1890,6 @@ drag_grab (GdkDrag *drag)
|
||||
|
||||
g_set_object (&x11_drag->grab_seat, seat);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
|
||||
{
|
||||
int deviceid = gdk_x11_device_get_id (gdk_seat_get_keyboard (seat));
|
||||
unsigned char mask[XIMaskLen(XI_LASTEVENT)];
|
||||
XIGrabModifiers mods;
|
||||
XIEventMask evmask;
|
||||
int num_mods;
|
||||
|
||||
keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display),
|
||||
grab_keys[i].keysym);
|
||||
if (keycode == NoSymbol)
|
||||
continue;
|
||||
|
||||
memset (mask, 0, sizeof (mask));
|
||||
XISetMask (mask, XI_KeyPress);
|
||||
XISetMask (mask, XI_KeyRelease);
|
||||
|
||||
evmask.deviceid = deviceid;
|
||||
evmask.mask_len = sizeof (mask);
|
||||
evmask.mask = mask;
|
||||
|
||||
num_mods = 1;
|
||||
mods.modifiers = grab_keys[i].modifiers;
|
||||
|
||||
XIGrabKeycode (GDK_DISPLAY_XDISPLAY (display),
|
||||
deviceid,
|
||||
keycode,
|
||||
root,
|
||||
GrabModeAsync,
|
||||
GrabModeAsync,
|
||||
False,
|
||||
&evmask,
|
||||
num_mods,
|
||||
&mods);
|
||||
}
|
||||
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1971,41 +1897,13 @@ static void
|
||||
drag_ungrab (GdkDrag *drag)
|
||||
{
|
||||
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
|
||||
GdkDisplay *display;
|
||||
GdkDevice *keyboard;
|
||||
Window root;
|
||||
int keycode, i;
|
||||
|
||||
if (!x11_drag->grab_seat)
|
||||
return;
|
||||
|
||||
gdk_seat_ungrab (x11_drag->grab_seat);
|
||||
|
||||
display = gdk_drag_get_display (drag);
|
||||
keyboard = gdk_seat_get_keyboard (x11_drag->grab_seat);
|
||||
root = GDK_DISPLAY_XROOTWIN (display);
|
||||
g_clear_object (&x11_drag->grab_seat);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
|
||||
{
|
||||
XIGrabModifiers mods;
|
||||
int num_mods;
|
||||
|
||||
keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display),
|
||||
grab_keys[i].keysym);
|
||||
if (keycode == NoSymbol)
|
||||
continue;
|
||||
|
||||
num_mods = 1;
|
||||
mods.modifiers = grab_keys[i].modifiers;
|
||||
|
||||
XIUngrabKeycode (GDK_DISPLAY_XDISPLAY (display),
|
||||
gdk_x11_device_get_id (keyboard),
|
||||
keycode,
|
||||
root,
|
||||
num_mods,
|
||||
&mods);
|
||||
}
|
||||
}
|
||||
|
||||
GdkDrag *
|
||||
@@ -2232,103 +2130,6 @@ gdk_dnd_handle_motion_event (GdkDrag *drag,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_dnd_handle_key_event (GdkDrag *drag,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
|
||||
GdkModifierType state;
|
||||
GdkDevice *pointer;
|
||||
GdkSeat *seat;
|
||||
int dx, dy;
|
||||
|
||||
dx = dy = 0;
|
||||
state = gdk_event_get_modifier_state (event);
|
||||
seat = gdk_event_get_seat (event);
|
||||
pointer = gdk_seat_get_pointer (seat);
|
||||
|
||||
if (event->event_type == GDK_KEY_PRESS)
|
||||
{
|
||||
guint keyval = gdk_key_event_get_keyval (event);
|
||||
|
||||
switch (keyval)
|
||||
{
|
||||
case GDK_KEY_Escape:
|
||||
gdk_drag_cancel (drag, GDK_DRAG_CANCEL_USER_CANCELLED);
|
||||
return TRUE;
|
||||
|
||||
case GDK_KEY_space:
|
||||
case GDK_KEY_Return:
|
||||
case GDK_KEY_ISO_Enter:
|
||||
case GDK_KEY_KP_Enter:
|
||||
case GDK_KEY_KP_Space:
|
||||
if ((gdk_drag_get_selected_action (drag) != 0) &&
|
||||
(x11_drag->proxy_xid != None))
|
||||
{
|
||||
g_signal_emit_by_name (drag, "drop-performed");
|
||||
}
|
||||
else
|
||||
gdk_drag_cancel (drag, GDK_DRAG_CANCEL_NO_TARGET);
|
||||
|
||||
return TRUE;
|
||||
|
||||
case GDK_KEY_Up:
|
||||
case GDK_KEY_KP_Up:
|
||||
dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
|
||||
break;
|
||||
|
||||
case GDK_KEY_Down:
|
||||
case GDK_KEY_KP_Down:
|
||||
dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
|
||||
break;
|
||||
|
||||
case GDK_KEY_Left:
|
||||
case GDK_KEY_KP_Left:
|
||||
dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
|
||||
break;
|
||||
|
||||
case GDK_KEY_Right:
|
||||
case GDK_KEY_KP_Right:
|
||||
dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The state is not yet updated in the event, so we need
|
||||
* to query it here. We could use XGetModifierMapping, but
|
||||
* that would be overkill.
|
||||
*/
|
||||
gdk_x11_device_xi2_query_state (pointer, NULL, NULL, NULL, &state);
|
||||
|
||||
if (dx != 0 || dy != 0)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
Display *xdisplay;
|
||||
GdkX11Screen *screen;
|
||||
Window dest;
|
||||
|
||||
x11_drag->last_x += dx;
|
||||
x11_drag->last_y += dy;
|
||||
|
||||
display = gdk_event_get_display ((GdkEvent *)event);
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
screen = GDK_X11_DISPLAY (display)->screen;
|
||||
dest = GDK_SCREEN_XROOTWIN (screen);
|
||||
|
||||
XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0,
|
||||
round (x11_drag->last_x * screen->surface_scale),
|
||||
round (x11_drag->last_y * screen->surface_scale));
|
||||
}
|
||||
|
||||
gdk_drag_update (drag, x11_drag->last_x, x11_drag->last_y, state,
|
||||
gdk_event_get_time (event));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_dnd_handle_grab_broken_event (GdkDrag *drag,
|
||||
GdkEvent *event)
|
||||
@@ -2395,10 +2196,6 @@ gdk_x11_drag_handle_event (GdkDrag *drag,
|
||||
case GDK_BUTTON_RELEASE:
|
||||
return gdk_dnd_handle_button_event (drag, event);
|
||||
|
||||
case GDK_KEY_PRESS:
|
||||
case GDK_KEY_RELEASE:
|
||||
return gdk_dnd_handle_key_event (drag, event);
|
||||
|
||||
case GDK_GRAB_BROKEN:
|
||||
return gdk_dnd_handle_grab_broken_event (drag, event);
|
||||
|
||||
|
||||
+36
-11
@@ -162,7 +162,7 @@ gdk_x11_gl_context_glx_end_frame (GdkDrawContext *draw_context,
|
||||
if (display_x11->has_glx_video_sync)
|
||||
glXGetVideoSyncSGI (&end_frame_counter);
|
||||
|
||||
if (self->do_frame_sync && !display_x11->has_glx_swap_interval)
|
||||
if (self->do_frame_sync && !display_x11->has_glx_sgi_swap_control && !display_x11->has_glx_swap_control)
|
||||
{
|
||||
glFinish ();
|
||||
|
||||
@@ -249,7 +249,7 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
|
||||
if (!glXMakeContextCurrent (dpy, drawable, drawable, self->glx_context))
|
||||
return FALSE;
|
||||
|
||||
if (!surfaceless && GDK_X11_DISPLAY (display)->has_glx_swap_interval)
|
||||
if (!surfaceless)
|
||||
{
|
||||
/* If the WM is compositing there is no particular need to delay
|
||||
* the swap when drawing on the offscreen, rendering to the screen
|
||||
@@ -257,14 +257,35 @@ gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
|
||||
* to the vblank. */
|
||||
do_frame_sync = ! gdk_display_is_composited (display);
|
||||
|
||||
if (do_frame_sync != self->do_frame_sync)
|
||||
if (GDK_X11_DISPLAY (display)->has_glx_swap_control)
|
||||
{
|
||||
self->do_frame_sync = do_frame_sync;
|
||||
if (do_frame_sync != self->do_frame_sync)
|
||||
{
|
||||
self->do_frame_sync = do_frame_sync;
|
||||
|
||||
if (do_frame_sync)
|
||||
glXSwapIntervalSGI (1);
|
||||
else
|
||||
glXSwapIntervalSGI (0);
|
||||
if (do_frame_sync)
|
||||
glXSwapIntervalEXT (dpy, drawable, 1);
|
||||
else
|
||||
glXSwapIntervalEXT (dpy, drawable, 0);
|
||||
}
|
||||
}
|
||||
else if (GDK_X11_DISPLAY (display)->has_glx_sgi_swap_control)
|
||||
{
|
||||
/* If the WM is compositing there is no particular need to delay
|
||||
* the swap when drawing on the offscreen, rendering to the screen
|
||||
* happens later anyway, and its up to the compositor to sync that
|
||||
* to the vblank. */
|
||||
do_frame_sync = ! gdk_display_is_composited (display);
|
||||
|
||||
if (do_frame_sync != self->do_frame_sync)
|
||||
{
|
||||
self->do_frame_sync = do_frame_sync;
|
||||
|
||||
if (do_frame_sync)
|
||||
glXSwapIntervalSGI (1);
|
||||
else
|
||||
glXSwapIntervalSGI (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,7 +509,7 @@ gdk_x11_context_create_glx_context (GdkGLContext *context,
|
||||
|
||||
/* We will use the default version matching the context status
|
||||
* unless the user requested a version which makes sense */
|
||||
gdk_gl_context_get_matching_version (api, legacy, 0,
|
||||
gdk_gl_context_get_matching_version (api, legacy,
|
||||
&min_major, &min_minor);
|
||||
gdk_gl_context_get_clipped_version (context, min_major, min_minor,
|
||||
&major, &minor);
|
||||
@@ -925,8 +946,10 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
|
||||
epoxy_has_glx_extension (dpy, screen_num, "GLX_ARB_create_context_profile");
|
||||
display_x11->has_glx_create_es2_context =
|
||||
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_create_context_es2_profile");
|
||||
display_x11->has_glx_swap_interval =
|
||||
display_x11->has_glx_sgi_swap_control =
|
||||
epoxy_has_glx_extension (dpy, screen_num, "GLX_SGI_swap_control");
|
||||
display_x11->has_glx_swap_control =
|
||||
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_swap_control");
|
||||
display_x11->has_glx_texture_from_pixmap =
|
||||
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_texture_from_pixmap");
|
||||
display_x11->has_glx_video_sync =
|
||||
@@ -987,6 +1010,7 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
|
||||
"\t* GLX_ARB_create_context_profile: %s\n"
|
||||
"\t* GLX_EXT_create_context_es2_profile: %s\n"
|
||||
"\t* GLX_SGI_swap_control: %s\n"
|
||||
"\t* GLX_EXT_swap_control: %s\n"
|
||||
"\t* GLX_EXT_texture_from_pixmap: %s\n"
|
||||
"\t* GLX_SGI_video_sync: %s\n"
|
||||
"\t* GLX_EXT_buffer_age: %s\n"
|
||||
@@ -998,7 +1022,8 @@ gdk_x11_display_init_glx (GdkX11Display *display_x11,
|
||||
glXGetClientString (dpy, GLX_VENDOR),
|
||||
display_x11->has_glx_create_context ? "yes" : "no",
|
||||
display_x11->has_glx_create_es2_context ? "yes" : "no",
|
||||
display_x11->has_glx_swap_interval ? "yes" : "no",
|
||||
display_x11->has_glx_sgi_swap_control ? "yes" : "no",
|
||||
display_x11->has_glx_swap_control ? "yes" : "no",
|
||||
display_x11->has_glx_texture_from_pixmap ? "yes" : "no",
|
||||
display_x11->has_glx_video_sync ? "yes" : "no",
|
||||
display_x11->has_glx_buffer_age ? "yes" : "no",
|
||||
|
||||
+19
-3
@@ -685,8 +685,13 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
for (i = 0; i < resources->noutput; ++i)
|
||||
{
|
||||
RROutput output = resources->outputs[i];
|
||||
XRROutputInfo *output_info =
|
||||
XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
|
||||
XRROutputInfo *output_info;
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
output_info = XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
continue;
|
||||
|
||||
if (output_info->connection == RR_Disconnected)
|
||||
{
|
||||
@@ -697,13 +702,22 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
if (output_info->crtc)
|
||||
{
|
||||
GdkX11Monitor *monitor;
|
||||
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
|
||||
XRRCrtcInfo *crtc;
|
||||
char *name;
|
||||
GdkRectangle geometry;
|
||||
GdkRectangle newgeo;
|
||||
int j;
|
||||
int refresh_rate = 0;
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
{
|
||||
XRRFreeOutputInfo (output_info);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < resources->nmode; j++)
|
||||
{
|
||||
XRRModeInfo *xmode = &resources->modes[j];
|
||||
@@ -775,8 +789,10 @@ init_randr13 (GdkX11Screen *x11_screen)
|
||||
}
|
||||
|
||||
x11_display->primary_monitor = 0;
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
primary_output = XRRGetOutputPrimary (x11_screen->xdisplay,
|
||||
x11_screen->xroot_window);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)); i++)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
|
||||
if (size == 0)
|
||||
{
|
||||
/* EOF marker, put it back */
|
||||
g_async_queue_push_front_unlocked (priv->chunks, bytes);
|
||||
g_async_queue_push_front_unlocked (priv->chunks, g_steal_pointer (&bytes));
|
||||
break;
|
||||
}
|
||||
else if (size > count)
|
||||
@@ -107,7 +107,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
|
||||
memcpy (buffer, g_bytes_get_data (bytes, NULL), size);
|
||||
}
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
g_bytes_unref (g_steal_pointer (&bytes));
|
||||
result += size;
|
||||
if (buffer)
|
||||
buffer += size;
|
||||
@@ -165,9 +165,7 @@ gdk_x11_selection_input_stream_complete (GdkX11SelectionInputStream *stream)
|
||||
GDK_X11_DISPLAY (priv->display)->streams = g_slist_remove (GDK_X11_DISPLAY (priv->display)->streams, stream);
|
||||
g_signal_handlers_disconnect_by_func (priv->display,
|
||||
gdk_x11_selection_input_stream_xevent,
|
||||
stream);
|
||||
|
||||
g_object_unref (stream);
|
||||
g_steal_pointer (&stream));
|
||||
}
|
||||
|
||||
static gssize
|
||||
@@ -416,7 +414,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
|
||||
"%s:%s: got PropertyNotify erroring out of INCR",
|
||||
priv->selection, priv->target);
|
||||
/* error, should we signal one? */
|
||||
gdk_x11_selection_input_stream_complete (stream);
|
||||
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
|
||||
}
|
||||
else if (g_bytes_get_size (bytes) == 0 || type == None)
|
||||
{
|
||||
@@ -424,7 +422,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
|
||||
"%s:%s: got PropertyNotify ending INCR",
|
||||
priv->selection, priv->target);
|
||||
g_bytes_unref (bytes);
|
||||
gdk_x11_selection_input_stream_complete (stream);
|
||||
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -467,7 +465,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
_("Format %s not supported"), priv->target);
|
||||
gdk_x11_selection_input_stream_complete (stream);
|
||||
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -478,7 +476,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
|
||||
|
||||
if (bytes == NULL)
|
||||
{
|
||||
gdk_x11_selection_input_stream_complete (stream);
|
||||
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -500,7 +498,7 @@ gdk_x11_selection_input_stream_xevent (GdkDisplay *display,
|
||||
g_bytes_get_size (bytes));
|
||||
g_async_queue_push (priv->chunks, bytes);
|
||||
|
||||
gdk_x11_selection_input_stream_complete (stream);
|
||||
g_clear_pointer (&stream, gdk_x11_selection_input_stream_complete);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +539,10 @@ gdk_x11_selection_input_stream_new_async (GdkDisplay *display,
|
||||
priv->property = g_strdup_printf ("GDK_SELECTION_%p", stream);
|
||||
priv->xproperty = gdk_x11_get_xatom_by_name_for_display (display, priv->property);
|
||||
|
||||
g_signal_connect (display, "xevent", G_CALLBACK (gdk_x11_selection_input_stream_xevent), stream);
|
||||
g_signal_connect_data (display, "xevent",
|
||||
G_CALLBACK (gdk_x11_selection_input_stream_xevent),
|
||||
g_steal_pointer (&stream),
|
||||
(GClosureNotify) g_object_unref, 0);
|
||||
|
||||
XConvertSelection (GDK_DISPLAY_XDISPLAY (display),
|
||||
priv->xselection,
|
||||
@@ -577,7 +578,6 @@ gdk_x11_selection_input_stream_new_finish (GAsyncResult *result,
|
||||
*type = priv->type;
|
||||
if (format)
|
||||
*format = priv->format;
|
||||
g_object_ref (stream);
|
||||
}
|
||||
|
||||
return G_INPUT_STREAM (stream);
|
||||
|
||||
@@ -208,6 +208,8 @@ gdk_x11_surface_update_size (GdkX11Surface *self,
|
||||
cairo_surface_set_device_scale (self->cairo_surface, scale, scale);
|
||||
}
|
||||
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,6 +662,10 @@ gsk_gl_command_queue_split_draw (GskGLCommandQueue *self)
|
||||
|
||||
g_assert (GSK_IS_GL_COMMAND_QUEUE (self));
|
||||
g_assert (self->batches.len > 0);
|
||||
|
||||
if (will_ignore_batch (self))
|
||||
return;
|
||||
|
||||
g_assert (self->in_draw == TRUE);
|
||||
|
||||
program = self->program_info;
|
||||
@@ -1002,8 +1006,11 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation (GL_FUNC_ADD);
|
||||
|
||||
glGenVertexArrays (1, &vao_id);
|
||||
glBindVertexArray (vao_id);
|
||||
if (!gdk_gl_context_get_use_es (self->context))
|
||||
{
|
||||
glGenVertexArrays (1, &vao_id);
|
||||
glBindVertexArray (vao_id);
|
||||
}
|
||||
|
||||
vbo_id = gsk_gl_buffer_submit (&self->vertices);
|
||||
|
||||
@@ -1159,7 +1166,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
}
|
||||
|
||||
glDeleteBuffers (1, &vbo_id);
|
||||
glDeleteVertexArrays (1, &vao_id);
|
||||
if (!gdk_gl_context_get_use_es (self->context))
|
||||
glDeleteVertexArrays (1, &vao_id);
|
||||
|
||||
gdk_profiler_set_int_counter (self->metrics.n_binds, n_binds);
|
||||
gdk_profiler_set_int_counter (self->metrics.n_uniforms, n_uniforms);
|
||||
|
||||
@@ -733,7 +733,7 @@ gsk_gl_driver_load_texture (GskGLDriver *self,
|
||||
|
||||
format = GL_RGBA8;
|
||||
|
||||
if (GDK_IS_GL_TEXTURE (texture))
|
||||
if (GDK_IS_GL_TEXTURE (texture) && min_filter == GL_LINEAR && mag_filter == GL_LINEAR)
|
||||
{
|
||||
GdkGLTexture *gl_texture = (GdkGLTexture *) texture;
|
||||
GdkGLContext *texture_context = gdk_gl_texture_get_context (gl_texture);
|
||||
|
||||
@@ -372,7 +372,11 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
return texture;
|
||||
}
|
||||
|
||||
format = gsk_render_node_prefers_high_depth (root) ? GL_RGBA32F : GL_RGBA8;
|
||||
if (gsk_render_node_prefers_high_depth (root) &&
|
||||
gdk_gl_context_check_version (self->context, 3, 0, 3, 0))
|
||||
format = GL_RGBA32F;
|
||||
else
|
||||
format = GL_RGBA8;
|
||||
|
||||
gdk_gl_context_make_current (self->context);
|
||||
|
||||
|
||||
+45
-19
@@ -254,7 +254,7 @@ gsk_rounded_rect_shrink_to_minimum (GskRoundedRect *self)
|
||||
static inline gboolean G_GNUC_PURE
|
||||
node_supports_2d_transform (const GskRenderNode *node)
|
||||
{
|
||||
switch ((int)gsk_render_node_get_node_type (node))
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GSK_COLOR_NODE:
|
||||
case GSK_OPACITY_NODE:
|
||||
@@ -272,6 +272,7 @@ node_supports_2d_transform (const GskRenderNode *node)
|
||||
case GSK_CAIRO_NODE:
|
||||
case GSK_BLEND_NODE:
|
||||
case GSK_BLUR_NODE:
|
||||
case GSK_MASK_NODE:
|
||||
return TRUE;
|
||||
|
||||
case GSK_SHADOW_NODE:
|
||||
@@ -288,8 +289,18 @@ node_supports_2d_transform (const GskRenderNode *node)
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
case GSK_BORDER_NODE:
|
||||
case GSK_INSET_SHADOW_NODE:
|
||||
case GSK_OUTSET_SHADOW_NODE:
|
||||
case GSK_REPEAT_NODE:
|
||||
case GSK_CLIP_NODE:
|
||||
case GSK_ROUNDED_CLIP_NODE:
|
||||
case GSK_GL_SHADER_NODE:
|
||||
return FALSE;
|
||||
|
||||
case GSK_NOT_A_RENDER_NODE:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +314,7 @@ node_supports_transform (const GskRenderNode *node)
|
||||
* opacity or color matrix.
|
||||
*/
|
||||
|
||||
switch ((int)gsk_render_node_get_node_type (node))
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GSK_COLOR_NODE:
|
||||
case GSK_OPACITY_NODE:
|
||||
@@ -324,8 +335,25 @@ node_supports_transform (const GskRenderNode *node)
|
||||
case GSK_TRANSFORM_NODE:
|
||||
return node_supports_transform (gsk_transform_node_get_child (node));
|
||||
|
||||
default:
|
||||
case GSK_CONTAINER_NODE:
|
||||
case GSK_LINEAR_GRADIENT_NODE:
|
||||
case GSK_REPEATING_LINEAR_GRADIENT_NODE:
|
||||
case GSK_RADIAL_GRADIENT_NODE:
|
||||
case GSK_REPEATING_RADIAL_GRADIENT_NODE:
|
||||
case GSK_CONIC_GRADIENT_NODE:
|
||||
case GSK_BORDER_NODE:
|
||||
case GSK_INSET_SHADOW_NODE:
|
||||
case GSK_OUTSET_SHADOW_NODE:
|
||||
case GSK_REPEAT_NODE:
|
||||
case GSK_CLIP_NODE:
|
||||
case GSK_ROUNDED_CLIP_NODE:
|
||||
case GSK_GL_SHADER_NODE:
|
||||
case GSK_TEXTURE_SCALE_NODE:
|
||||
return FALSE;
|
||||
|
||||
case GSK_NOT_A_RENDER_NODE:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,23 +563,21 @@ extract_matrix_metadata (GskGLRenderModelview *modelview)
|
||||
case GSK_TRANSFORM_CATEGORY_ANY:
|
||||
case GSK_TRANSFORM_CATEGORY_3D:
|
||||
{
|
||||
graphene_vec3_t col1;
|
||||
graphene_vec3_t col2;
|
||||
graphene_quaternion_t rotation;
|
||||
graphene_vec4_t perspective;
|
||||
graphene_vec3_t translation;
|
||||
graphene_vec3_t scale;
|
||||
graphene_vec3_t shear;
|
||||
|
||||
/* TODO: 90% sure this is incorrect. But we should never hit this code
|
||||
* path anyway. */
|
||||
graphene_vec3_init (&col1,
|
||||
graphene_matrix_get_value (&modelview->matrix, 0, 0),
|
||||
graphene_matrix_get_value (&modelview->matrix, 1, 0),
|
||||
graphene_matrix_get_value (&modelview->matrix, 2, 0));
|
||||
graphene_matrix_decompose (&modelview->matrix,
|
||||
&translation,
|
||||
&scale,
|
||||
&rotation,
|
||||
&shear,
|
||||
&perspective);
|
||||
|
||||
graphene_vec3_init (&col2,
|
||||
graphene_matrix_get_value (&modelview->matrix, 0, 1),
|
||||
graphene_matrix_get_value (&modelview->matrix, 1, 1),
|
||||
graphene_matrix_get_value (&modelview->matrix, 2, 1));
|
||||
|
||||
modelview->scale_x = graphene_vec3_length (&col1);
|
||||
modelview->scale_y = graphene_vec3_length (&col2);
|
||||
modelview->scale_x = graphene_vec3_get_x (&scale);
|
||||
modelview->scale_y = graphene_vec3_get_y (&scale);
|
||||
modelview->dx = 0;
|
||||
modelview->dy = 0;
|
||||
}
|
||||
|
||||
@@ -377,6 +377,8 @@ gsk_renderer_render_texture (GskRenderer *renderer,
|
||||
gsk_render_node_get_bounds (root, &real_viewport);
|
||||
viewport = &real_viewport;
|
||||
}
|
||||
g_return_val_if_fail (viewport->size.width > 0, NULL);
|
||||
g_return_val_if_fail (viewport->size.height > 0, NULL);
|
||||
|
||||
texture = GSK_RENDERER_GET_CLASS (renderer)->render_texture (renderer, root, viewport);
|
||||
|
||||
|
||||
@@ -4108,6 +4108,11 @@ gsk_shadow_node_draw (GskRenderNode *node,
|
||||
pattern = cairo_pop_group (cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_save (cr);
|
||||
/* clip so the blur area stays small */
|
||||
gsk_cairo_rectangle (cr, &node->bounds);
|
||||
cairo_clip (cr);
|
||||
|
||||
for (i = 0; i < self->n_shadows; i++)
|
||||
{
|
||||
GskShadow *shadow = &self->shadows[i];
|
||||
@@ -4129,6 +4134,7 @@ gsk_shadow_node_draw (GskRenderNode *node,
|
||||
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_paint (cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_pattern_destroy (pattern);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,10 @@ parse_texture (GtkCssParser *parser,
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (&error,
|
||||
GTK_CSS_PARSER_ERROR,
|
||||
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
|
||||
"Failed to resolve URL");
|
||||
texture = NULL;
|
||||
}
|
||||
}
|
||||
@@ -229,8 +233,19 @@ parse_script (GtkCssParser *parser,
|
||||
GFile *file;
|
||||
|
||||
file = gtk_css_parser_resolve_url (parser, url);
|
||||
bytes = g_file_load_bytes (file, NULL, NULL, &error);
|
||||
g_object_unref (file);
|
||||
if (file)
|
||||
{
|
||||
bytes = g_file_load_bytes (file, NULL, NULL, &error);
|
||||
g_object_unref (file);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (&error,
|
||||
GTK_CSS_PARSER_ERROR,
|
||||
GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
|
||||
"Failed to resolve URL");
|
||||
bytes = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (scheme);
|
||||
@@ -416,7 +431,10 @@ parse_string (GtkCssParser *parser,
|
||||
|
||||
token = gtk_css_parser_get_token (parser);
|
||||
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_STRING))
|
||||
return FALSE;
|
||||
{
|
||||
gtk_css_parser_error_syntax (parser, "Expected a string");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s = g_strdup (gtk_css_token_get_string (token));
|
||||
gtk_css_parser_consume_token (parser);
|
||||
|
||||
@@ -142,10 +142,10 @@ collect_states (GtkAtSpiContext *self,
|
||||
accessible = gtk_at_context_get_accessible (ctx);
|
||||
|
||||
set_atspi_state (&states, ATSPI_STATE_VISIBLE);
|
||||
set_atspi_state (&states, ATSPI_STATE_SHOWING);
|
||||
|
||||
if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_WINDOW)
|
||||
{
|
||||
set_atspi_state (&states, ATSPI_STATE_SHOWING);
|
||||
if (gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE))
|
||||
set_atspi_state (&states, ATSPI_STATE_ACTIVE);
|
||||
}
|
||||
@@ -918,6 +918,7 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
{
|
||||
gtk_at_spi_root_child_changed (self->root, change, accessible);
|
||||
emit_state_changed (self, "showing", gtk_boolean_accessible_value_get (value));
|
||||
emit_state_changed (self, "visible", gtk_boolean_accessible_value_get (value));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
|
||||
return ATSPI_ROLE_ALERT;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_ALERT_DIALOG:
|
||||
return ATSPI_ROLE_DIALOG;
|
||||
return ATSPI_ROLE_ALERT;
|
||||
|
||||
case GTK_ACCESSIBLE_ROLE_BANNER:
|
||||
break;
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
* button events, however some customized derived areas can be implemented
|
||||
* who are interested in handling other events. Handling an event can
|
||||
* trigger the [`signal@Gtk.CellArea::focus-changed`] signal to fire; as well
|
||||
* as [`signal@GtkCellArea::add-editable`] in the case that an editable cell
|
||||
* as [`signal@Gtk.CellArea::add-editable`] in the case that an editable cell
|
||||
* was clicked and needs to start editing. You can call
|
||||
* [method@Gtk.CellArea.stop_editing] at any time to cancel any cell editing
|
||||
* that is currently in progress.
|
||||
|
||||
@@ -37,7 +37,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
* [class@Gtk.FontChooserWidget], [class@Gtk.FontChooserDialog] and
|
||||
* [class@Gtk.FontButton].
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* The font description as a string, e.g. "Sans Italic 12".
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -73,7 +73,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* The font description as a `PangoFontDescription`.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -86,7 +86,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* The string with which to preview the font.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -99,7 +99,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* Whether to show an entry to change the preview text.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -112,7 +112,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* The level of granularity to offer for selecting fonts.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -131,7 +131,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
* The format of the string is compatible with
|
||||
* CSS and with Pango attributes.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -144,7 +144,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
*
|
||||
* The language for which the font features were selected.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
g_object_interface_install_property
|
||||
(iface,
|
||||
@@ -163,7 +163,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
* or an item is selected and the user presses one of the keys
|
||||
* Space, Shift+Space, Return or Enter.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton] instead
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton] instead
|
||||
*/
|
||||
chooser_signals[SIGNAL_FONT_ACTIVATED] =
|
||||
g_signal_new (I_("font-activated"),
|
||||
@@ -189,7 +189,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
|
||||
* Returns: (nullable) (transfer none): A `PangoFontFamily` representing the
|
||||
* selected font family
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
PangoFontFamily *
|
||||
@@ -212,7 +212,7 @@ gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser)
|
||||
* Returns: (nullable) (transfer none): A `PangoFontFace` representing the
|
||||
* selected font group details
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
PangoFontFace *
|
||||
@@ -232,7 +232,7 @@ gtk_font_chooser_get_font_face (GtkFontChooser *fontchooser)
|
||||
* Returns: A n integer representing the selected font size,
|
||||
* or -1 if no font size is selected.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
int
|
||||
@@ -261,7 +261,7 @@ gtk_font_chooser_get_font_size (GtkFontChooser *fontchooser)
|
||||
* Returns: (nullable) (transfer full): A string with the name
|
||||
* of the current font
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
char *
|
||||
@@ -284,7 +284,7 @@ gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Sets the currently-selected font.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -315,7 +315,7 @@ gtk_font_chooser_set_font (GtkFontChooser *fontchooser,
|
||||
* Returns: (nullable) (transfer full): A `PangoFontDescription` for the
|
||||
* current font
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
PangoFontDescription *
|
||||
@@ -337,7 +337,7 @@ gtk_font_chooser_get_font_desc (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Sets the currently-selected font from @font_desc.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -358,7 +358,7 @@ gtk_font_chooser_set_font_desc (GtkFontChooser *fontchooser,
|
||||
*
|
||||
* Returns: (transfer full): the text displayed in the preview area
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
char *
|
||||
@@ -382,7 +382,7 @@ gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* The @text is used to show how the selected font looks.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -403,7 +403,7 @@ gtk_font_chooser_set_preview_text (GtkFontChooser *fontchooser,
|
||||
*
|
||||
* Returns: %TRUE if the preview entry is shown or %FALSE if it is hidden.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
gboolean
|
||||
@@ -425,7 +425,7 @@ gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Shows or hides the editable preview entry.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -448,7 +448,7 @@ gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
|
||||
* Adds a filter function that decides which fonts to display
|
||||
* in the font chooser.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -505,7 +505,7 @@ _gtk_font_chooser_font_activated (GtkFontChooser *chooser,
|
||||
* pango_context_set_font_map (context, fontmap);
|
||||
* ```
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -528,7 +528,7 @@ gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
|
||||
*
|
||||
* Returns: (nullable) (transfer full): a `PangoFontMap`
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
PangoFontMap *
|
||||
@@ -551,7 +551,7 @@ gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Sets the desired level of granularity for selecting fonts.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
@@ -571,7 +571,7 @@ gtk_font_chooser_set_level (GtkFontChooser *fontchooser,
|
||||
*
|
||||
* Returns: the current granularity level
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
GtkFontChooserLevel
|
||||
@@ -598,7 +598,7 @@ gtk_font_chooser_get_level (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Returns: the currently selected font features
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
char *
|
||||
@@ -621,7 +621,7 @@ gtk_font_chooser_get_font_features (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Returns: the currently selected language
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
char *
|
||||
@@ -643,7 +643,7 @@ gtk_font_chooser_get_language (GtkFontChooser *fontchooser)
|
||||
*
|
||||
* Sets the language to use for font features.
|
||||
*
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@GtkFontDialogButton]
|
||||
* Deprecated: 4.10: Use [class@Gtk.FontDialog] and [class@Gtk.FontDialogButton]
|
||||
* instead
|
||||
*/
|
||||
void
|
||||
|
||||
@@ -126,7 +126,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
* style class applied.
|
||||
*
|
||||
* Deprecated: 4.10: There is no replacement in GTK for an "info bar" widget;
|
||||
* you can use [class@Gtk.Revealer] with a [class@GtkBox] containing a
|
||||
* you can use [class@Gtk.Revealer] with a [class@Gtk.Box] containing a
|
||||
* [class@Gtk.Label] and an optional [class@Gtk.Button], according to
|
||||
* your application's design.
|
||||
*/
|
||||
|
||||
@@ -284,7 +284,8 @@ extract_plane (GdkPixbuf *src,
|
||||
int to_plane)
|
||||
{
|
||||
guchar *src_data, *dst_data;
|
||||
int width, height, src_stride, dst_stride;
|
||||
int width, height;
|
||||
gsize src_stride, dst_stride;
|
||||
guchar *src_row, *dst_row;
|
||||
int x, y;
|
||||
|
||||
|
||||
@@ -460,6 +460,9 @@ gsk_pango_renderer_release (GskPangoRenderer *renderer)
|
||||
* Creates render nodes for rendering @layout in the given foregound @color
|
||||
* and appends them to the current node of @snapshot without changing the
|
||||
* current node.
|
||||
*
|
||||
* Note that if the layout does not produce any visible output, then nodes
|
||||
* may not be added to the @snapshot.
|
||||
**/
|
||||
void
|
||||
gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
||||
|
||||
+11
-14
@@ -249,25 +249,21 @@ gtk_accessible_get_next_accessible_sibling (GtkAccessible *self)
|
||||
g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), NULL);
|
||||
|
||||
GtkATContext *context;
|
||||
GtkAccessible *sibling = NULL;
|
||||
|
||||
context = gtk_accessible_get_at_context (self);
|
||||
if (context != NULL)
|
||||
if (context != NULL && gtk_at_context_get_accessible_parent (context) != NULL)
|
||||
{
|
||||
GtkAccessible *sibling = NULL;
|
||||
|
||||
if (gtk_at_context_get_accessible_parent (context) != NULL)
|
||||
{
|
||||
sibling = gtk_at_context_get_next_accessible_sibling (context);
|
||||
if (sibling != NULL)
|
||||
sibling = g_object_ref (sibling);
|
||||
}
|
||||
|
||||
g_object_unref (context);
|
||||
|
||||
return sibling;
|
||||
sibling = gtk_at_context_get_next_accessible_sibling (context);
|
||||
if (sibling != NULL)
|
||||
sibling = g_object_ref (sibling);
|
||||
}
|
||||
else
|
||||
return GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self);
|
||||
sibling = GTK_ACCESSIBLE_GET_IFACE (self)->get_next_accessible_sibling (self);
|
||||
|
||||
g_clear_object (&context);
|
||||
|
||||
return sibling;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -834,6 +830,7 @@ static const char *role_names[] = {
|
||||
[GTK_ACCESSIBLE_ROLE_TREE_ITEM] = NC_("accessibility", "tree item"),
|
||||
[GTK_ACCESSIBLE_ROLE_WIDGET] = NC_("accessibility", "widget"),
|
||||
[GTK_ACCESSIBLE_ROLE_WINDOW] = NC_("accessibility", "window"),
|
||||
[GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON] = NC_("accessibility", "toggle button"),
|
||||
};
|
||||
|
||||
/*< private >
|
||||
|
||||
@@ -232,6 +232,8 @@ gtk_action_muxer_list_actions (GtkActionMuxer *muxer,
|
||||
GHashTable *actions;
|
||||
char **keys;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ACTION_MUXER (muxer), NULL);
|
||||
|
||||
actions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
|
||||
for ( ; muxer != NULL; muxer = muxer->parent)
|
||||
@@ -323,6 +325,9 @@ gtk_action_muxer_get_group (GtkActionMuxer *muxer,
|
||||
{
|
||||
Group *group;
|
||||
|
||||
if (!muxer->groups)
|
||||
return NULL;
|
||||
|
||||
group = g_hash_table_lookup (muxer->groups, group_name);
|
||||
if (group)
|
||||
return group->group;
|
||||
@@ -450,7 +455,7 @@ notify_observers_added (GtkActionMuxer *muxer,
|
||||
|
||||
gtk_action_observable_register_observer (GTK_ACTION_OBSERVABLE (parent), action_name, GTK_ACTION_OBSERVER (muxer));
|
||||
|
||||
if (!action_muxer_query_action (parent, action_name,
|
||||
if (!action_muxer_query_action (muxer, action_name,
|
||||
&enabled, ¶meter_type,
|
||||
NULL, NULL, &state,
|
||||
TRUE))
|
||||
|
||||
@@ -74,7 +74,7 @@ gboolean gtk_action_muxer_query_action (GtkActi
|
||||
const GVariantType **parameter_type,
|
||||
const GVariantType **state_type,
|
||||
GVariant **state_hint,
|
||||
GVariant **state);
|
||||
GVariant **state) G_GNUC_WARN_UNUSED_RESULT;
|
||||
void gtk_action_muxer_activate_action (GtkActionMuxer *muxer,
|
||||
const char *action_name,
|
||||
GVariant *parameter);
|
||||
|
||||
+19
-10
@@ -352,6 +352,21 @@ gtk_adjustment_dispatch_properties_changed (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static double
|
||||
gtk_adjustment_sanitize_value (GtkAdjustment *self,
|
||||
double value)
|
||||
{
|
||||
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (self);
|
||||
|
||||
/* don't use CLAMP() so we don't end up below lower if upper - page_size
|
||||
* is smaller than lower
|
||||
*/
|
||||
value = MIN (value, priv->upper - priv->page_size);
|
||||
value = MAX (value, priv->lower);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_adjustment_new:
|
||||
* @value: the initial value
|
||||
@@ -419,6 +434,8 @@ adjustment_set_value (GtkAdjustment *adjustment,
|
||||
{
|
||||
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
||||
|
||||
value = gtk_adjustment_sanitize_value (adjustment, value);
|
||||
|
||||
if (priv->value != value)
|
||||
{
|
||||
priv->value = value;
|
||||
@@ -497,11 +514,7 @@ gtk_adjustment_set_value_internal (GtkAdjustment *adjustment,
|
||||
{
|
||||
GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment);
|
||||
|
||||
/* don't use CLAMP() so we don't end up below lower if upper - page_size
|
||||
* is smaller than lower
|
||||
*/
|
||||
value = MIN (value, priv->upper - priv->page_size);
|
||||
value = MAX (value, priv->lower);
|
||||
value = gtk_adjustment_sanitize_value (adjustment, value);
|
||||
|
||||
if (animate && priv->duration != 0 && priv->clock != NULL)
|
||||
{
|
||||
@@ -825,11 +838,7 @@ gtk_adjustment_configure (GtkAdjustment *adjustment,
|
||||
gtk_adjustment_set_page_increment (adjustment, page_increment);
|
||||
gtk_adjustment_set_page_size (adjustment, page_size);
|
||||
|
||||
/* don't use CLAMP() so we don't end up below lower if upper - page_size
|
||||
* is smaller than lower
|
||||
*/
|
||||
value = MIN (value, upper - page_size);
|
||||
value = MAX (value, lower);
|
||||
value = gtk_adjustment_sanitize_value (adjustment, value);
|
||||
|
||||
if (value != priv->value)
|
||||
{
|
||||
|
||||
@@ -747,6 +747,9 @@ gtk_alert_dialog_choose_finish (GtkAlertDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), -1);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_alert_dialog_choose, -1);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return (int) g_task_propagate_int (G_TASK (result), error);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ struct _GtkBuildableParser
|
||||
* @set_buildable_property: Sets a property of a buildable object.
|
||||
* It is normally not necessary to implement this, g_object_set_property()
|
||||
* is used by default. `GtkWindow` implements this to delay showing itself
|
||||
* (i.e. setting the [property@GtkWidget:visible] property) until the whole
|
||||
* (i.e. setting the [property@Gtk.Widget:visible] property) until the whole
|
||||
* interface is created.
|
||||
* @construct_child: Constructs a child of a buildable that has been
|
||||
* specified as “constructor” in the UI definition. This can be used to
|
||||
|
||||
+5
-1
@@ -288,6 +288,9 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
*
|
||||
* This is an action signal. Applications should never connect
|
||||
* to this signal, but use the [signal@Gtk.Button::clicked] signal.
|
||||
*
|
||||
* The default bindings for this signal are all forms of the
|
||||
* <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
*/
|
||||
button_signals[ACTIVATE] =
|
||||
g_signal_new (I_("activate"),
|
||||
@@ -669,7 +672,8 @@ gtk_button_new_from_icon_name (const char *icon_name)
|
||||
* If characters in @label are preceded by an underscore, they are underlined.
|
||||
* If you need a literal underscore character in a label, use “__” (two
|
||||
* underscores). The first underlined character represents a keyboard
|
||||
* accelerator called a mnemonic. Pressing Alt and that key activates the button.
|
||||
* accelerator called a mnemonic. Pressing <kbd>Alt</kbd> and that key
|
||||
* activates the button.
|
||||
*
|
||||
* Returns: a new `GtkButton`
|
||||
*/
|
||||
|
||||
@@ -481,16 +481,15 @@ gtk_check_button_focus (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
g_ptr_array_free (child_array, TRUE);
|
||||
|
||||
if (new_focus)
|
||||
if (new_focus && new_focus != widget)
|
||||
{
|
||||
gtk_widget_grab_focus (new_focus);
|
||||
gtk_widget_activate (new_focus);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_ptr_array_free (child_array, TRUE);
|
||||
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -673,6 +672,9 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
|
||||
* Applications should never connect to this signal, but use the
|
||||
* [signal@Gtk.CheckButton::toggled] signal.
|
||||
*
|
||||
* The default bindings for this signal are all forms of the
|
||||
* <kbd>␣</kbd> and <kbd>Enter</kbd> keys.
|
||||
*
|
||||
* Since: 4.2
|
||||
*/
|
||||
signals[ACTIVATE] =
|
||||
|
||||
@@ -492,6 +492,9 @@ gtk_color_dialog_choose_rgba_finish (GtkColorDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_color_dialog_choose_rgba, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (result), error);
|
||||
}
|
||||
|
||||
|
||||
+43
-10
@@ -88,7 +88,7 @@ gtk_css_value_corner_transition (GtkCssValue *start,
|
||||
|
||||
static void
|
||||
gtk_css_value_corner_print (const GtkCssValue *corner,
|
||||
GString *string)
|
||||
GString *string)
|
||||
{
|
||||
_gtk_css_value_print (corner->x, string);
|
||||
if (!_gtk_css_value_equal (corner->x, corner->y))
|
||||
@@ -109,16 +109,55 @@ static const GtkCssValueClass GTK_CSS_VALUE_CORNER = {
|
||||
gtk_css_value_corner_print
|
||||
};
|
||||
|
||||
static GtkCssValue corner_singletons[] = {
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
{ >K_CSS_VALUE_CORNER, 1, TRUE, NULL, NULL },
|
||||
};
|
||||
|
||||
static inline void
|
||||
initialize_corner_singletons (void)
|
||||
{
|
||||
static gboolean initialized = FALSE;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
for (unsigned int i = 0; i < G_N_ELEMENTS (corner_singletons); i++)
|
||||
{
|
||||
corner_singletons[i].x = gtk_css_dimension_value_new (i, GTK_CSS_PX);
|
||||
corner_singletons[i].y = gtk_css_value_ref (corner_singletons[i].x);
|
||||
}
|
||||
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_corner_value_new (GtkCssValue *x,
|
||||
GtkCssValue *y)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
|
||||
if (_gtk_css_value_equal (x, y))
|
||||
if (x == y &&
|
||||
gtk_css_number_value_get_dimension (x) == GTK_CSS_DIMENSION_LENGTH)
|
||||
{
|
||||
_gtk_css_value_unref (y);
|
||||
return x;
|
||||
initialize_corner_singletons ();
|
||||
|
||||
for (unsigned int i = 0; i < G_N_ELEMENTS (corner_singletons); i++)
|
||||
{
|
||||
if (corner_singletons[i].x == x)
|
||||
{
|
||||
gtk_css_value_unref (x);
|
||||
gtk_css_value_unref (y);
|
||||
|
||||
return gtk_css_value_ref (&corner_singletons[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_CORNER);
|
||||
@@ -162,9 +201,6 @@ double
|
||||
_gtk_css_corner_value_get_x (const GtkCssValue *corner,
|
||||
double one_hundred_percent)
|
||||
{
|
||||
if (corner->class != >K_CSS_VALUE_CORNER)
|
||||
return _gtk_css_number_value_get (corner, one_hundred_percent);
|
||||
|
||||
g_return_val_if_fail (corner != NULL, 0.0);
|
||||
g_return_val_if_fail (corner->class == >K_CSS_VALUE_CORNER, 0.0);
|
||||
|
||||
@@ -175,9 +211,6 @@ double
|
||||
_gtk_css_corner_value_get_y (const GtkCssValue *corner,
|
||||
double one_hundred_percent)
|
||||
{
|
||||
if (corner->class != >K_CSS_VALUE_CORNER)
|
||||
return _gtk_css_number_value_get (corner, one_hundred_percent);
|
||||
|
||||
g_return_val_if_fail (corner != NULL, 0.0);
|
||||
g_return_val_if_fail (corner->class == >K_CSS_VALUE_CORNER, 0.0);
|
||||
|
||||
|
||||
@@ -102,10 +102,10 @@ gtk_css_filter_clear (GtkCssFilter *filter)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
GtkCssFilterType type)
|
||||
gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
const GtkCssFilter *other)
|
||||
{
|
||||
switch (type)
|
||||
switch (other->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
filter->brightness.value = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
|
||||
@@ -135,7 +135,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
filter->blur.value = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
break;
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
filter->drop_shadow.value = gtk_css_shadow_value_new_filter ();
|
||||
filter->drop_shadow.value = gtk_css_shadow_value_new_filter (other->drop_shadow.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
default:
|
||||
@@ -143,7 +143,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
break;
|
||||
}
|
||||
|
||||
filter->type = type;
|
||||
filter->type = other->type;
|
||||
}
|
||||
|
||||
#define R 0.2126
|
||||
@@ -466,7 +466,7 @@ gtk_css_value_filter_equal (const GtkCssValue *value1,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, larger->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &larger->filters[i]);
|
||||
|
||||
if (!gtk_css_filter_equal (&larger->filters[i], &filter))
|
||||
{
|
||||
@@ -590,7 +590,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, start->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &start->filters[i]);
|
||||
gtk_css_filter_transition (&result->filters[i],
|
||||
&start->filters[i],
|
||||
&filter,
|
||||
@@ -602,7 +602,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, end->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &end->filters[i]);
|
||||
gtk_css_filter_transition (&result->filters[i],
|
||||
&filter,
|
||||
&end->filters[i],
|
||||
|
||||
@@ -75,7 +75,8 @@ gtk_css_value_font_features_equal (const GtkCssValue *value1,
|
||||
g_hash_table_iter_init (&iter, value1->features);
|
||||
while (g_hash_table_iter_next (&iter, &name, &val1))
|
||||
{
|
||||
val2 = g_hash_table_lookup (value2->features, name);
|
||||
if (!g_hash_table_lookup_extended (value2->features, name, NULL, &val2))
|
||||
return FALSE;
|
||||
|
||||
if (val1 != val2)
|
||||
return FALSE;
|
||||
@@ -106,11 +107,10 @@ gtk_css_value_font_features_transition (GtkCssValue *start,
|
||||
g_hash_table_iter_init (&iter, start->features);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&start_val))
|
||||
{
|
||||
end_val = g_hash_table_lookup (end->features, name);
|
||||
if (end_val == NULL)
|
||||
if (!g_hash_table_lookup_extended (end->features, name, NULL, &end_val))
|
||||
transition = start_val;
|
||||
else
|
||||
transition = progress > 0.5 ? start_val : end_val;
|
||||
transition = progress < 0.5 ? start_val : end_val;
|
||||
|
||||
gtk_css_font_features_value_add_feature (result, name, GPOINTER_TO_INT (transition));
|
||||
}
|
||||
@@ -118,8 +118,7 @@ gtk_css_value_font_features_transition (GtkCssValue *start,
|
||||
g_hash_table_iter_init (&iter, end->features);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&end_val))
|
||||
{
|
||||
start_val = g_hash_table_lookup (start->features, name);
|
||||
if (start_val != NULL)
|
||||
if (g_hash_table_lookup_extended (end->features, name, NULL, &start_val))
|
||||
continue;
|
||||
|
||||
gtk_css_font_features_value_add_feature (result, name, GPOINTER_TO_INT (end_val));
|
||||
|
||||
+1
-15
@@ -47,21 +47,7 @@ gtk_css_image_url_load_image (GtkCssImageUrl *url,
|
||||
return url->loaded_image;
|
||||
}
|
||||
|
||||
/* We special case resources here so we can use gdk_texture_new_from_resource. */
|
||||
if (g_file_has_uri_scheme (url->file, "resource"))
|
||||
{
|
||||
char *uri = g_file_get_uri (url->file);
|
||||
char *resource_path = g_uri_unescape_string (uri + strlen ("resource://"), NULL);
|
||||
|
||||
texture = gdk_texture_new_from_resource (resource_path);
|
||||
|
||||
g_free (resource_path);
|
||||
g_free (uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
texture = gdk_texture_new_from_file (url->file, &local_error);
|
||||
}
|
||||
texture = gdk_texture_new_from_file (url->file, &local_error);
|
||||
|
||||
if (texture == NULL)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
case GTK_CSS_PROPERTY_FONT_FAMILY:
|
||||
settings = gtk_style_provider_get_settings (provider);
|
||||
if (settings && gtk_settings_get_font_family (settings) != NULL)
|
||||
return _gtk_css_string_value_new (gtk_settings_get_font_family (settings));
|
||||
return _gtk_css_array_value_new (_gtk_css_string_value_new (gtk_settings_get_font_family (settings)));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
+1
-1
@@ -713,7 +713,7 @@ gtk_css_node_reposition (GtkCssNode *node,
|
||||
{
|
||||
GTK_CSS_NODE_GET_CLASS (old_parent)->node_removed (old_parent, node, node->previous_sibling);
|
||||
if (old_parent->children_observer && old_parent != new_parent)
|
||||
gtk_list_list_model_item_removed (old_parent->children_observer, previous);
|
||||
gtk_list_list_model_item_removed (old_parent->children_observer, old_previous);
|
||||
if (old_parent->first_child && node->visible)
|
||||
gtk_css_node_invalidate (old_parent->first_child, GTK_CSS_CHANGE_NTH_LAST_CHILD);
|
||||
}
|
||||
|
||||
+11
-6
@@ -380,6 +380,9 @@ gtk_css_dimension_value_new (double value,
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 2 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 3 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 4 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 5 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 6 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 7 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 8 }} },
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 16 }} }, /* Icon size default */
|
||||
{ >K_CSS_VALUE_NUMBER, 1, TRUE, TYPE_DIMENSION, {{ GTK_CSS_PX, 32 }} },
|
||||
@@ -418,16 +421,18 @@ gtk_css_dimension_value_new (double value,
|
||||
value == 1 ||
|
||||
value == 2 ||
|
||||
value == 3 ||
|
||||
value == 4)
|
||||
value == 4 ||
|
||||
value == 5 ||
|
||||
value == 6 ||
|
||||
value == 7 ||
|
||||
value == 8)
|
||||
return _gtk_css_value_ref (&px_singletons[(int) value]);
|
||||
if (value == 8)
|
||||
return _gtk_css_value_ref (&px_singletons[5]);
|
||||
if (value == 16)
|
||||
return _gtk_css_value_ref (&px_singletons[6]);
|
||||
return _gtk_css_value_ref (&px_singletons[9]);
|
||||
if (value == 32)
|
||||
return _gtk_css_value_ref (&px_singletons[7]);
|
||||
return _gtk_css_value_ref (&px_singletons[10]);
|
||||
if (value == 64)
|
||||
return _gtk_css_value_ref (&px_singletons[8]);
|
||||
return _gtk_css_value_ref (&px_singletons[11]);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -331,16 +331,16 @@ gtk_css_shadow_value_new (ShadowValue *shadows,
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
gtk_css_shadow_value_new_filter (void)
|
||||
gtk_css_shadow_value_new_filter (const GtkCssValue *other)
|
||||
{
|
||||
ShadowValue value;
|
||||
|
||||
value.inset = FALSE;
|
||||
value.hoffset = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
value.voffset = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
value.radius = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
value.spread = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
value.color = _gtk_css_color_value_new_current_color ();
|
||||
value.hoffset = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
value.voffset = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
value.radius = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
value.spread = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
value.color = gtk_css_value_ref (other->shadows[0].color);
|
||||
|
||||
return gtk_css_shadow_value_new (&value, 1, TRUE);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GtkCssValue * gtk_css_shadow_value_new_none (void);
|
||||
GtkCssValue * gtk_css_shadow_value_new_filter (void);
|
||||
GtkCssValue * gtk_css_shadow_value_new_filter (const GtkCssValue *other);
|
||||
|
||||
GtkCssValue * gtk_css_shadow_value_parse (GtkCssParser *parser,
|
||||
gboolean box_shadow_mode);
|
||||
|
||||
@@ -1095,25 +1095,29 @@ _gtk_css_style_property_init_properties (void)
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
|
||||
border_corner_radius_value_parse,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
||||
gtk_css_style_property_register ("border-top-right-radius",
|
||||
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
|
||||
border_corner_radius_value_parse,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
||||
gtk_css_style_property_register ("border-bottom-right-radius",
|
||||
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
|
||||
border_corner_radius_value_parse,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
||||
gtk_css_style_property_register ("border-bottom-left-radius",
|
||||
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
|
||||
border_corner_radius_value_parse,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
_gtk_css_corner_value_new (_gtk_css_number_value_new (0, GTK_CSS_PX),
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX)));
|
||||
|
||||
gtk_css_style_property_register ("outline-style",
|
||||
GTK_CSS_PROPERTY_OUTLINE_STYLE,
|
||||
@@ -1133,7 +1137,6 @@ _gtk_css_style_property_init_properties (void)
|
||||
GTK_CSS_AFFECTS_OUTLINE,
|
||||
outline_parse,
|
||||
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
|
||||
|
||||
gtk_css_style_property_register ("background-clip",
|
||||
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
|
||||
0,
|
||||
|
||||
@@ -142,7 +142,7 @@ gtk_css_transform_init_identity (GtkCssTransform *transform,
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
transform->rotate.x = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
transform->rotate.y = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
transform->rotate.z = _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
transform->rotate.z = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
|
||||
transform->rotate.angle = _gtk_css_number_value_new (0, GTK_CSS_DEG);
|
||||
break;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
|
||||
+1
-1
@@ -2098,7 +2098,7 @@ gtk_entry_get_visibility (GtkEntry *entry)
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_invisible_char: (attributes org.gtk.Method.sets_property=invisible-char)
|
||||
* gtk_entry_set_invisible_char: (attributes org.gtk.Method.set_property=invisible-char)
|
||||
* @entry: a `GtkEntry`
|
||||
* @ch: a Unicode character
|
||||
*
|
||||
|
||||
+2
-2
@@ -852,8 +852,6 @@ typedef enum {
|
||||
GTK_LEVEL_BAR_MODE_DISCRETE
|
||||
} GtkLevelBarMode;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
/**
|
||||
* GtkInputPurpose:
|
||||
* @GTK_INPUT_PURPOSE_FREE_FORM: Allow any character
|
||||
@@ -1670,4 +1668,6 @@ typedef enum { /*< prefix=GTK_ACCESSIBLE_SORT >*/
|
||||
GTK_ACCESSIBLE_SORT_OTHER
|
||||
} GtkAccessibleSort;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_ENUMS_H__ */
|
||||
|
||||
@@ -410,16 +410,22 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ABS (scroll->cur_dx) >= 1)
|
||||
if (ABS (scroll->cur_dx) >= 0.5)
|
||||
{
|
||||
steps = trunc (scroll->cur_dx);
|
||||
if (steps == 0)
|
||||
steps = (scroll->cur_dx > 0) ? 1 : -1;
|
||||
|
||||
scroll->cur_dx -= steps;
|
||||
dx = steps;
|
||||
}
|
||||
|
||||
if (ABS (scroll->cur_dy) >= 1)
|
||||
if (ABS (scroll->cur_dy) >= 0.5)
|
||||
{
|
||||
steps = trunc (scroll->cur_dy);
|
||||
if (steps == 0)
|
||||
steps = (scroll->cur_dy > 0) ? 1 : -1;
|
||||
|
||||
scroll->cur_dy -= steps;
|
||||
dy = steps;
|
||||
}
|
||||
@@ -459,16 +465,22 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
|
||||
scroll->cur_dy += dy;
|
||||
dx = dy = 0;
|
||||
|
||||
if (ABS (scroll->cur_dx) >= 1)
|
||||
if (ABS (scroll->cur_dx) >= 0.5)
|
||||
{
|
||||
steps = trunc (scroll->cur_dx);
|
||||
if (steps == 0)
|
||||
steps = (scroll->cur_dx > 0) ? 1 : -1;
|
||||
|
||||
scroll->cur_dx -= steps;
|
||||
dx = steps;
|
||||
}
|
||||
|
||||
if (ABS (scroll->cur_dy) >= 1)
|
||||
if (ABS (scroll->cur_dy) >= 0.5)
|
||||
{
|
||||
steps = trunc (scroll->cur_dy);
|
||||
if (steps == 0)
|
||||
steps = (scroll->cur_dy > 0) ? 1 : -1;
|
||||
|
||||
scroll->cur_dy -= steps;
|
||||
dy = steps;
|
||||
}
|
||||
|
||||
+5
-5
@@ -40,7 +40,7 @@
|
||||
* expanded widget yourself, such as when you want to actually create
|
||||
* the widget at expansion time. In this case, create a `GtkExpander`
|
||||
* but do not add a child to it. The expander widget has an
|
||||
* [property@Gtk.Expander:expanded[ property which can be used to
|
||||
* [property@Gtk.Expander:expanded] property which can be used to
|
||||
* monitor its expansion state. You should watch this property with
|
||||
* a signal connection as follows:
|
||||
*
|
||||
@@ -98,16 +98,16 @@
|
||||
* # CSS nodes
|
||||
*
|
||||
* ```
|
||||
* expander
|
||||
* expander-widget
|
||||
* ╰── box
|
||||
* ├── title
|
||||
* │ ├── arrow
|
||||
* │ ├── expander
|
||||
* │ ╰── <label widget>
|
||||
* ╰── <child>
|
||||
* ```
|
||||
*
|
||||
* `GtkExpander` has three CSS nodes, the main node with the name expander,
|
||||
* a subnode with name title and node below it with name arrow. The arrow of an
|
||||
* `GtkExpander` has three CSS nodes, the main node with the name expander-widget,
|
||||
* a subnode with name title and node below it with name expander. The arrow of an
|
||||
* expander that is showing its child gets the :checked pseudoclass added to it.
|
||||
*
|
||||
* # Accessibility
|
||||
|
||||
+17
-12
@@ -193,28 +193,30 @@ match_func (GtkEntryCompletion *compl,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFileChooserEntry *chooser_entry = user_data;
|
||||
GFileInfo *info;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store),
|
||||
iter,
|
||||
FILE_INFO_COLUMN, &info,
|
||||
-1);
|
||||
|
||||
g_assert (info != NULL);
|
||||
g_object_unref (info);
|
||||
|
||||
if (g_file_info_get_attribute_boolean (info, "filechooser::filtered-out"))
|
||||
return FALSE;
|
||||
|
||||
/* If we arrive here, the GtkFileSystemModel's GtkFileFilter already filtered out all
|
||||
* files that don't start with the current prefix, so we manually apply the GtkFileChooser's
|
||||
* current file filter (e.g. just jpg files) here. */
|
||||
* current file filter (e.g. just jpg files) here.
|
||||
*/
|
||||
if (chooser_entry->current_filter != NULL)
|
||||
{
|
||||
GFileInfo *info;
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (chooser_entry->completion_store),
|
||||
iter,
|
||||
FILE_INFO_COLUMN, &info,
|
||||
-1);
|
||||
|
||||
g_assert (info != NULL);
|
||||
g_object_unref (info);
|
||||
|
||||
/* We always allow navigating into subfolders, so don't ever filter directories */
|
||||
if (g_file_info_get_file_type (info) != G_FILE_TYPE_REGULAR)
|
||||
return TRUE;
|
||||
|
||||
g_assert (g_file_info_has_attribute (info, "standard::file"));
|
||||
|
||||
return gtk_filter_match (GTK_FILTER (chooser_entry->current_filter), info);
|
||||
}
|
||||
|
||||
@@ -598,6 +600,9 @@ model_items_changed_cb (GListModel *model,
|
||||
DISPLAY_NAME_COLUMN, display_name,
|
||||
-1);
|
||||
|
||||
g_free (display_name);
|
||||
g_free (full_path);
|
||||
|
||||
g_clear_object (&info);
|
||||
|
||||
position++;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "gtkfilechooserprivate.h"
|
||||
#include "deprecated/gtkfilechooserdialog.h"
|
||||
#include "deprecated/gtkfilechooser.h"
|
||||
#include "gtkfilechoosercellprivate.h"
|
||||
#include "gtkfilechooserentry.h"
|
||||
#include "gtkfilechooserutils.h"
|
||||
#include "gtkfilesystemmodelprivate.h"
|
||||
@@ -577,7 +578,10 @@ gtk_file_chooser_widget_finalize (GObject *object)
|
||||
stop_loading_and_clear_list_model (impl, FALSE);
|
||||
search_clear_model (impl, FALSE);
|
||||
recent_clear_model (impl, FALSE);
|
||||
g_clear_object (&impl->recent_model);
|
||||
g_clear_object (&impl->search_model);
|
||||
g_clear_object (&impl->model_for_search);
|
||||
g_clear_object (&impl->browse_files_model);
|
||||
|
||||
g_clear_object (&impl->selection_model);
|
||||
g_clear_object (&impl->sort_model);
|
||||
@@ -3980,6 +3984,7 @@ set_list_model (GtkFileChooserWidget *impl,
|
||||
|
||||
set_busy_cursor (impl, TRUE);
|
||||
|
||||
g_clear_object (&impl->browse_files_model);
|
||||
impl->browse_files_model =
|
||||
_gtk_file_system_model_new_for_directory (impl->current_folder, MODEL_ATTRIBUTES);
|
||||
|
||||
@@ -7304,6 +7309,7 @@ gtk_file_chooser_widget_init (GtkFileChooserWidget *impl)
|
||||
g_type_ensure (GTK_TYPE_PATH_BAR);
|
||||
g_type_ensure (GTK_TYPE_PLACES_VIEW);
|
||||
g_type_ensure (GTK_TYPE_PLACES_SIDEBAR);
|
||||
g_type_ensure (GTK_TYPE_FILE_CHOOSER_CELL);
|
||||
g_type_ensure (GTK_TYPE_FILE_CHOOSER_ERROR_STACK);
|
||||
|
||||
impl->select_multiple = FALSE;
|
||||
|
||||
@@ -976,6 +976,9 @@ gtk_file_dialog_open_finish (GtkFileDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_open, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return finish_file_op (self, G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -1050,6 +1053,9 @@ gtk_file_dialog_select_folder_finish (GtkFileDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_select_folder, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return finish_file_op (self, G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -1120,6 +1126,9 @@ gtk_file_dialog_save_finish (GtkFileDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_save, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return finish_file_op (self, G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -1194,6 +1203,9 @@ gtk_file_dialog_open_multiple_finish (GtkFileDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_open_multiple, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return finish_multiple_files_op (self, G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -1268,6 +1280,9 @@ gtk_file_dialog_select_multiple_folders_finish (GtkFileDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_file_dialog_select_multiple_folders, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return finish_multiple_files_op (self, G_TASK (result), error);
|
||||
}
|
||||
|
||||
|
||||
+13
-14
@@ -229,9 +229,9 @@ open_done (GObject *source,
|
||||
#endif
|
||||
|
||||
static void
|
||||
show_folder_done (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
show_item_done (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GDBusConnection *bus = G_DBUS_CONNECTION (source);
|
||||
GTask *task = G_TASK (data);
|
||||
@@ -261,11 +261,10 @@ show_folder_done (GObject *source,
|
||||
#define FILE_MANAGER_DBUS_PATH "/org/freedesktop/FileManager1"
|
||||
|
||||
static void
|
||||
show_folder (GtkWindow *parent,
|
||||
const char *uri,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
show_item (GtkWindow *parent,
|
||||
const char *uri,
|
||||
GCancellable *cancellable,
|
||||
GTask *task)
|
||||
{
|
||||
GDBusConnection *bus;
|
||||
GVariantBuilder uris_builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_STRING_ARRAY);
|
||||
@@ -274,10 +273,10 @@ show_folder (GtkWindow *parent,
|
||||
|
||||
if (!bus)
|
||||
{
|
||||
g_task_return_new_error (G_TASK (user_data),
|
||||
g_task_return_new_error (task,
|
||||
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED,
|
||||
"Session bus not available");
|
||||
g_object_unref (G_TASK (user_data));
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -287,14 +286,14 @@ show_folder (GtkWindow *parent,
|
||||
FILE_MANAGER_DBUS_NAME,
|
||||
FILE_MANAGER_DBUS_PATH,
|
||||
FILE_MANAGER_DBUS_IFACE,
|
||||
"ShowFolders",
|
||||
"ShowItems",
|
||||
g_variant_new ("(ass)", &uris_builder, ""),
|
||||
NULL, /* ignore returned type */
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
cancellable,
|
||||
show_folder_done,
|
||||
user_data);
|
||||
show_item_done,
|
||||
task);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
@@ -470,7 +469,7 @@ gtk_file_launcher_open_containing_folder (GtkFileLauncher *self,
|
||||
{
|
||||
char *uri = g_file_get_uri (self->file);
|
||||
|
||||
show_folder (parent, uri, cancellable, show_folder_done, task);
|
||||
show_item (parent, uri, cancellable, task);
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
@@ -331,8 +331,6 @@ list_model_get_item (GListModel *list_model,
|
||||
GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (list_model);
|
||||
FileModelNode *node;
|
||||
|
||||
/* The first items of GtkFileSystemModel is not really a file,
|
||||
* so ignore it. */
|
||||
if (position >= model->files->len)
|
||||
return NULL;
|
||||
|
||||
@@ -386,6 +384,7 @@ gtk_file_system_model_refilter_all (GtkFileSystemModel *model)
|
||||
for (i = 0; i < model->files->len; i++)
|
||||
node_compute_visibility_and_filters (model, i);
|
||||
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), 0, model->files->len, model->files->len);
|
||||
model->filter_on_thaw = FALSE;
|
||||
thaw_updates (model);
|
||||
}
|
||||
@@ -410,6 +409,7 @@ thaw_updates (GtkFileSystemModel *model)
|
||||
if (stuff_added)
|
||||
{
|
||||
guint i;
|
||||
guint changed_idx = G_MAXUINT;
|
||||
|
||||
for (i = 0; i < model->files->len; i++)
|
||||
{
|
||||
@@ -417,9 +417,17 @@ thaw_updates (GtkFileSystemModel *model)
|
||||
|
||||
if (!node->frozen_add)
|
||||
continue;
|
||||
|
||||
node->frozen_add = FALSE;
|
||||
node_compute_visibility_and_filters (model, i);
|
||||
if (changed_idx == G_MAXUINT)
|
||||
changed_idx = i;
|
||||
}
|
||||
|
||||
if (changed_idx != G_MAXUINT)
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), changed_idx,
|
||||
model->files->len - changed_idx,
|
||||
model->files->len - changed_idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,9 +458,10 @@ add_file (GtkFileSystemModel *model,
|
||||
position = model->files->len - 1;
|
||||
|
||||
if (!model->frozen)
|
||||
node_compute_visibility_and_filters (model, position);
|
||||
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), position, 0, 1);
|
||||
{
|
||||
node_compute_visibility_and_filters (model, position);
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), position, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -502,7 +511,7 @@ remove_file (GtkFileSystemModel *model,
|
||||
|
||||
g_array_remove_index (model->files, id);
|
||||
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), id - 1, 1, 0);
|
||||
g_list_model_items_changed (G_LIST_MODEL (model), id, 1, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -739,7 +748,9 @@ gtk_file_system_model_monitor_change (GFileMonitor * monitor,
|
||||
case G_FILE_MONITOR_EVENT_CREATED:
|
||||
case G_FILE_MONITOR_EVENT_CHANGED:
|
||||
case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
|
||||
/* We can treat all of these the same way */
|
||||
if (g_file_equal (file, model->dir))
|
||||
return;
|
||||
/* We can treat all children the same way */
|
||||
g_file_query_info_async (file,
|
||||
model->attributes,
|
||||
G_FILE_QUERY_INFO_NONE,
|
||||
|
||||
@@ -180,9 +180,6 @@ gtk_filter_list_model_run_filter (GtkFilterListModel *self,
|
||||
gtk_bitset_remove_range_closed (self->pending, 0, pos - 1);
|
||||
else
|
||||
g_clear_pointer (&self->pending, gtk_bitset_unref);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,6 +234,7 @@ gtk_filter_list_model_run_filter_cb (gpointer data)
|
||||
gtk_filter_list_model_stop_filtering (self);
|
||||
|
||||
gtk_filter_list_model_emit_items_changed_for_changes (self, old);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
@@ -857,6 +855,7 @@ gtk_filter_list_model_set_incremental (GtkFilterListModel *self,
|
||||
gtk_filter_list_model_stop_filtering (self);
|
||||
|
||||
gtk_filter_list_model_emit_items_changed_for_changes (self, old);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PENDING]);
|
||||
}
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INCREMENTAL]);
|
||||
|
||||
+1
-1
@@ -538,7 +538,7 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
|
||||
*
|
||||
* Emitted when the user activates a child widget in a `GtkFlowBox`.
|
||||
*
|
||||
* This can be happen either by clicking or double-clicking,
|
||||
* This can happen either by clicking or double-clicking,
|
||||
* or via a keybinding.
|
||||
*
|
||||
* This is a [keybinding signal](class.SignalAction.html),
|
||||
|
||||
@@ -697,6 +697,9 @@ gtk_font_dialog_choose_family_finish (GtkFontDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_family, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -777,6 +780,9 @@ gtk_font_dialog_choose_face_finish (GtkFontDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_face, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -855,6 +861,9 @@ gtk_font_dialog_choose_font_finish (GtkFontDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font, NULL);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
|
||||
return g_task_propagate_pointer (G_TASK (result), error);
|
||||
}
|
||||
|
||||
@@ -944,6 +953,8 @@ gtk_font_dialog_choose_font_and_features_finish (GtkFontDialog *self,
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
|
||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font_and_features, FALSE);
|
||||
|
||||
/* Destroy the dialog window not to be bound to GTask lifecycle */
|
||||
g_task_set_task_data (G_TASK (result), NULL, NULL);
|
||||
font_result = g_task_propagate_pointer (G_TASK (result), error);
|
||||
|
||||
if (font_result)
|
||||
|
||||
@@ -150,6 +150,7 @@ _gtk_gesture_click_update_timeout (GtkGestureClick *gesture)
|
||||
|
||||
static gboolean
|
||||
_gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture,
|
||||
const char *setting,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
@@ -165,9 +166,7 @@ _gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture,
|
||||
|
||||
widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
g_object_get (settings,
|
||||
"gtk-double-click-distance", &double_click_distance,
|
||||
NULL);
|
||||
g_object_get (settings, setting, &double_click_distance, NULL);
|
||||
|
||||
if (ABS (priv->initial_press_x - x) < double_click_distance &&
|
||||
ABS (priv->initial_press_y - y) < double_click_distance)
|
||||
@@ -220,7 +219,8 @@ gtk_gesture_click_begin (GtkGesture *gesture,
|
||||
_gtk_gesture_click_update_timeout (click);
|
||||
gtk_gesture_get_point (gesture, current, &x, &y);
|
||||
|
||||
if (!_gtk_gesture_click_check_within_threshold (click, x, y))
|
||||
if (gdk_device_get_source (priv->current_device) == GDK_SOURCE_MOUSE &&
|
||||
!_gtk_gesture_click_check_within_threshold (click, "gtk-double-click-distance", x, y))
|
||||
_gtk_gesture_click_stop (click);
|
||||
|
||||
/* Increment later the real counter, just if the gesture is
|
||||
@@ -250,7 +250,7 @@ gtk_gesture_click_update (GtkGesture *gesture,
|
||||
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
||||
gtk_gesture_get_point (gesture, current, &x, &y);
|
||||
|
||||
if (!_gtk_gesture_click_check_within_threshold (click, x, y))
|
||||
if (!_gtk_gesture_click_check_within_threshold (click, "gtk-dnd-drag-threshold", x, y))
|
||||
_gtk_gesture_click_stop (click);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ gtk_gesture_stylus_handle_event (GtkEventController *controller,
|
||||
priv = gtk_gesture_stylus_get_instance_private (GTK_GESTURE_STYLUS (controller));
|
||||
GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_stylus_parent_class)->handle_event (controller, event, x, y);
|
||||
|
||||
if (!(priv->stylus_only || gdk_event_get_device_tool (event)))
|
||||
if (priv->stylus_only && !gdk_event_get_device_tool (event))
|
||||
return FALSE;
|
||||
|
||||
switch ((guint) gdk_event_get_event_type (event))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user