None of the controls in the UI were responding to mouse or keyboard events.
The issue was likely caused by one or more of the following:
-
Central Panel Event Consumption: The central panel was using
Sense::click_and_drag()which could potentially consume events meant for other UI elements. -
Window Focus/Activation: The window might not have been properly activated or focused on creation.
-
egui Style Configuration: Default interaction settings might not have been optimal for the UI.
Changed from:
let (rect, _response) = ui.allocate_exact_size(
available_size,
egui::Sense::click_and_drag()
);Changed to:
let (rect, response) = ui.allocate_exact_size(
available_size,
egui::Sense::hover()
);Rationale: Sense::hover() is less aggressive about consuming events compared to Sense::click_and_drag(), allowing buttons and other interactive elements to receive their events properly. We're also now capturing the response (even if not currently using it) which is good practice.
Changed from:
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_title("rCandle - GRBL Controller")
.with_inner_size([1280.0, 800.0])
.with_min_inner_size([800.0, 600.0]),
..Default::default()
};Changed to:
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_title("rCandle - GRBL Controller")
.with_inner_size([1280.0, 800.0])
.with_min_inner_size([800.0, 600.0])
.with_active(true)
.with_visible(true),
..Default::default()
};Rationale: Explicitly requesting the window to be active and visible on creation ensures it has proper focus and can receive input events from the window manager.
Added:
// Configure egui style for better interactivity
let mut style = (*cc.egui_ctx.style()).clone();
style.interaction.selectable_labels = true;
cc.egui_ctx.set_style(style);Rationale: Ensures that egui's interaction system is properly configured with selectable labels enabled, which can improve overall UI responsiveness.
Added logging to connection buttons:
if ui.button("Connect").clicked() {
tracing::info!("Connect button clicked");
self.status_message = "Connecting...".to_string();
self.console.info("Connect button clicked".to_string());
}Rationale: Helps diagnose whether button clicks are being registered, making future debugging easier.
After these changes:
- Build the application:
cargo build - Run the application:
cargo run - Test interactions:
- Click buttons in the left control panel
- Use menu items in the top menu bar
- Type in the console at the bottom
- Use keyboard shortcuts (Ctrl+O, Ctrl+S, Ctrl+F)
- Interact with sliders and other controls
All UI controls should now respond to:
- Mouse clicks
- Mouse hover (for tooltips and visual feedback)
- Keyboard input (text fields, shortcuts)
- Drag operations (sliders, scrollbars)
- The central panel's 2D toolpath viewer should still be visible and render correctly
- The WGPU 3D rendering backend should not interfere with egui's event handling
- All existing functionality should remain intact
If UI controls still don't respond after these changes, check:
- Window Manager Focus: Ensure the window actually has focus (click on it)
- Input Method: If using remote desktop or virtualization, ensure proper input forwarding
- Graphics Drivers: Update graphics drivers, especially for Vulkan/WGPU support
- egui Version Compatibility: Current version is 0.27.2 - consider updating if issues persist
- Platform-Specific Issues: Check egui-winit issues on GitHub for Linux-specific problems
src/ui/app.rs- Main UI application logicsrc/main.rs- Application entry point and window configurationsrc/ui/widgets.rs- Custom UI widgets (GCodeEditor, Console)
2025-10-05
rCandle v0.1.0