summaryrefslogtreecommitdiff
path: root/src/corelib/x11/fpg_x11.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2009-03-20 14:28:21 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2009-03-20 14:28:21 +0000
commit13ae577973bc4402f21ab6d547f423f2f95c5157 (patch)
treefc8564fe304fa808fc378c30739b7dd5669415d9 /src/corelib/x11/fpg_x11.pas
parentbc3cbd7679af7b609b5726f8f8ce269878b1bab6 (diff)
downloadfpGUI-13ae577973bc4402f21ab6d547f423f2f95c5157.tar.xz
* Minor X11 debugging improvements.
* Named internal components * Introduced TfpgBaseCheckbox class. * Refactored text drawing in ComboBox to a method that can be overridden in descendants. * Implemented a new (experimental) Calendar Combo with Checkbox for optional date selection. * Added Calendar Combo Check component to UI Designer. * Fixed some missing properties from Calendar Combo component in UI Designer.
Diffstat (limited to 'src/corelib/x11/fpg_x11.pas')
-rw-r--r--src/corelib/x11/fpg_x11.pas13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 6aad85d0..a906ff2b 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -118,8 +118,6 @@ type
TfpgWindowImpl = class;
- { TfpgFontResourceImpl }
-
TfpgFontResourceImpl = class(TfpgFontResourceBase)
private
FFontData: PXftFont;
@@ -949,7 +947,11 @@ begin
{$IFDEF DEBUG}
- WriteLn('Event ',GetXEventName(ev._type),': ', ev._type,' window: ', ev.xany.window);
+ w := FindWindowByHandle(ev.xany.window);
+ if not Assigned(w) then
+ WriteLn('Event ',GetXEventName(ev._type),'(', ev._type,') window: ', IntToHex(ev.xany.window,7))
+ else
+ WriteLn('Event ',GetXEventName(ev._type),'(', ev._type,') window: ', IntToHex(ev.xany.window,7), ' name:', w.Name);
// PrintKeyEvent(ev); { debug purposes only }
{$ENDIF}
@@ -989,11 +991,16 @@ begin
msgp.keyboard.keycode := KeySymToKeycode(KeySym);
msgp.keyboard.shiftstate := ConvertShiftState(ev.xkey.state);
+ // By default X11 sends keyboard event to window under mouse cursor.
+ // We need to get the corrected "focused" widget instead.
kwg := FindKeyboardFocus;
if kwg <> nil then
w := kwg
else
begin
+ {$IFDEF DEBUG}
+ writeln('ERR: We couldn''t find keyboard focused window. Using event window instead!');
+ {$ENDIF}
w := FindWindowByHandle(ev.xkey.window);
if not Assigned(w) then
ReportLostWindow(ev);