Fix: Garbage string when searching in menu #112719
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112719
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123:search-type-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In debug mode, garbage string is displayed when searching in menu.
This is because
utf8_buf
was copied toinitial query
propertystring.
Not sure if this is replicable on other systems but I've been observing this for last 4-5 days
This is not quite right. We need the
initial_query
, otherwise the search will start out empty which is not intended. The question is why there is some garbage in the buffer.I've noticed this too, thanks for looking into it! But I think it's searching in menus rather than panels, just to be picky about the naming ;)
I might be misunderstanding something but when we press some key to invoke search operation, shouldn't the text field be empty by default?
Sorry for that 😅
No, it should contain the key that you pressed so that you don't have to press it again.
Ah, right. Didn't noticed this earlier.
I can take a look after some time today. But if you have quick fix, feel free to commit 🙂
I don't have a quick fix right now, sry.
see: wm_event_system.cc
@ -1916,3 +1916,3 @@
"initial_query",
nullptr,
0,
2,
Haven't tested it yet, but generally an utf8 buffer can have 1-4 bytes.
but we only need first char from the buffer (i.e. pressed key), no? :)
(And the search menu is only invoked when A-to-Z letters are pressed so the
pressed letter
is always within 1 byte)Yeah, but the
initial_query
input could totally be used elsewhere in the future. Fixing the issue here at that level seems wrong.Better only change where the operator is invoked, because the actual error is passing in the debug values. You should be able to get the correct size for the first utf8 char using
BLI_str_utf8_as_unicode_step_safe
. Otherwise just pass in the first byte since we are only dealing with a-z there for now anyway as I rightly pointed out.Fix: Garbage string when searching in panelsto Fix: Garbage string when searching in menuSorry for wasting your time on this one with unclear instructions. By "better only change where the operator is invoked" I meant the
ui_handle_menu_letter_press
function which calls the operator.I committed the fix I had in mind now:
eef2a706b4
.Thanks :)
Pull request closed