|
|
@ -9,6 +9,7 @@ struct _MousePanel |
|
|
|
GtkLabel* mouse_name; |
|
|
|
GtkLabel* mouse_name; |
|
|
|
AdwPreferencesGroup* dpi_preference_group; |
|
|
|
AdwPreferencesGroup* dpi_preference_group; |
|
|
|
AdwButtonContent* dpi_stage_add_button; |
|
|
|
AdwButtonContent* dpi_stage_add_button; |
|
|
|
|
|
|
|
AdwSwitchRow* motion_sync_switchrow; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (MousePanel, mouse_panel, panel_get_type()) |
|
|
|
G_DEFINE_TYPE (MousePanel, mouse_panel, panel_get_type()) |
|
|
@ -25,6 +26,7 @@ mouse_panel_class_init(MousePanelClass* klass) |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, mouse_name); |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, mouse_name); |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, dpi_preference_group); |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, dpi_preference_group); |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, dpi_stage_add_button); |
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, dpi_stage_add_button); |
|
|
|
|
|
|
|
gtk_widget_class_bind_template_child(widget_class, MousePanel, motion_sync_switchrow); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
@ -95,4 +97,14 @@ void mouse_panel_set_device(MousePanel* self, device_t* device) |
|
|
|
adw_preferences_group_add(self->dpi_preference_group, GTK_WIDGET(row)); |
|
|
|
adw_preferences_group_add(self->dpi_preference_group, GTK_WIDGET(row)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set mouse 'motion sync' feature
|
|
|
|
|
|
|
|
bool motion_sync = false; |
|
|
|
|
|
|
|
int (*driver_mouse_motion_sync_get)(void*, bool*) = dlsym(device_driver(device), "driver_mouse_motion_sync_get"); |
|
|
|
|
|
|
|
int motionsync_res = driver_mouse_motion_sync_get(device_handle(device), &motion_sync); |
|
|
|
|
|
|
|
if(!motionsync_res) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
adw_switch_row_set_active(self->motion_sync_switchrow, motion_sync); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|