mirror of
https://github.com/artizirk/wdisplays.git
synced 2024-12-03 12:50:59 +02:00
Backport GTK4 changes
Includes refactoring to use GMenuModel and GtkEventController
This commit is contained in:
parent
71ce9741d1
commit
f3f2b9e9e2
@ -7,23 +7,6 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkPopover" id="modes">
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="mode_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_start">10</property>
|
||||
<property name="margin_end">10</property>
|
||||
<property name="margin_top">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="pos_x_adjustment">
|
||||
<property name="upper">16383</property>
|
||||
<property name="step_increment">1</property>
|
||||
@ -194,6 +177,7 @@
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="refresh">
|
||||
<property name="name">refresh</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">9</property>
|
||||
@ -245,7 +229,6 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="popover">transforms</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
@ -323,6 +306,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="width">
|
||||
<property name="name">width</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">4</property>
|
||||
@ -351,6 +335,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="height">
|
||||
<property name="name">height</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">4</property>
|
||||
@ -371,9 +356,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Select Mode Preset</property>
|
||||
<property name="margin_left">8</property>
|
||||
<property name="margin_start">8</property>
|
||||
<property name="popover">modes</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
@ -407,75 +390,4 @@
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="transforms">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="relative_to">rotate_button</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_start">10</property>
|
||||
<property name="margin_end">10</property>
|
||||
<property name="margin_top">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="rotate_0">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">transform.rotate_0</property>
|
||||
<property name="text" translatable="yes">Don't Rotate</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="rotate_90">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">transform.rotate_90</property>
|
||||
<property name="text" translatable="yes">Rotate 90°</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="rotate_180">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">transform.rotate_180</property>
|
||||
<property name="text" translatable="yes">Rotate 180°</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton" id="rotate_270">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">transform.rotate_270</property>
|
||||
<property name="text" translatable="yes">Rotate 270°</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
gnome = import('gnome')
|
||||
resources = gnome.compile_resources(
|
||||
'waydisplay-resources', 'resources.xml',
|
||||
'wdisplays-resources', 'resources.xml',
|
||||
source_dir : '.',
|
||||
c_name : 'waydisplay_resources')
|
||||
c_name : 'wdisplays_resources')
|
||||
|
||||
scour = find_program('scour', required: false)
|
||||
|
||||
|
@ -11,62 +11,6 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkPopover" id="main_menu">
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_start">10</property>
|
||||
<property name="margin_end">10</property>
|
||||
<property name="margin_top">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">app.auto-apply</property>
|
||||
<property name="text" translatable="yes">_Automatically Apply Changes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">app.capture-screens</property>
|
||||
<property name="text" translatable="yes">Show Screen Contents</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="action_name">app.show-overlay</property>
|
||||
<property name="text" translatable="yes">Overlay Screen Names</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkWindow" id="heads_window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">wdisplays</property>
|
||||
@ -171,8 +115,6 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin_left">8</property>
|
||||
<property name="margin_right">8</property>
|
||||
<property name="margin_start">8</property>
|
||||
<property name="margin_end">8</property>
|
||||
<property name="margin_top">8</property>
|
||||
@ -248,14 +190,14 @@
|
||||
<object class="GtkButtonBox" id="zoom_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="zoom_out">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Zoom Out</property>
|
||||
<signal name="clicked" handler="zoom_out" swapped="yes"/>
|
||||
<property name="action_name">app.zoom-out</property>
|
||||
<accelerator key="minus" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
@ -263,7 +205,6 @@
|
||||
<property name="icon_name">zoom-out-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="minus" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
@ -278,7 +219,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Zoom Reset</property>
|
||||
<signal name="clicked" handler="zoom_reset" swapped="yes"/>
|
||||
<property name="action_name">app.zoom-reset</property>
|
||||
<accelerator key="0" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
</object>
|
||||
<packing>
|
||||
@ -294,7 +235,8 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Zoom In</property>
|
||||
<signal name="clicked" handler="zoom_in" swapped="yes"/>
|
||||
<property name="action_name">app.zoom-in</property>
|
||||
<accelerator key="equal" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
@ -302,7 +244,6 @@
|
||||
<property name="icon_name">zoom-in-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="equal" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
@ -311,6 +252,9 @@
|
||||
<property name="non_homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@ -318,7 +262,6 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="popover">main_menu</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
@ -355,7 +298,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="apply_changes" swapped="no"/>
|
||||
<property name="action_name">app.apply-changes</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
@ -371,7 +314,7 @@
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="cancel_changes" swapped="no"/>
|
||||
<property name="action_name">app.cancel-changes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
|
766
src/main.c
766
src/main.c
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,8 @@
|
||||
cc = meson.get_compiler('c')
|
||||
m_dep = cc.find_library('m', required : false)
|
||||
rt_dep = cc.find_library('rt', required : false)
|
||||
gdk = dependency('gdk-3.0')
|
||||
gtk = dependency('gtk+-3.0')
|
||||
gdk = dependency('gdk-3.0', version: '>= 3.24')
|
||||
gtk = dependency('gtk+-3.0', version: '>= 3.24')
|
||||
assert(gdk.get_pkgconfig_variable('targets').split().contains('wayland'), 'Wayland GDK backend not present')
|
||||
epoxy = dependency('epoxy')
|
||||
|
||||
|
@ -205,10 +205,10 @@ struct wd_state {
|
||||
unsigned int reset_idle;
|
||||
|
||||
struct wd_render_head_data *clicked;
|
||||
/* top left, bottom right */
|
||||
struct wd_point click_offset;
|
||||
struct wd_point drag_start;
|
||||
struct wd_point head_drag_start; /* 0-1 range in head rect */
|
||||
bool panning;
|
||||
struct wd_point pan_last;
|
||||
struct wd_point pan_start;
|
||||
|
||||
GtkWidget *main_box;
|
||||
GtkWidget *header_stack;
|
||||
|
Loading…
Reference in New Issue
Block a user