DirectFB:Notes

 

DFBWindow Focus and Input Control

From DirectFBWiki


DBFWindows will get focus or keyboard input based on the window manager rerouting the input into the window, for example if the mouse moves over a window, it will receive the DWET_GOT_FOCUS message, and when the cursor leaves the window it will receive the DWET_LOSTFOCUS.

If you want to control this further, here are some things good to know.

You could tell a specific window to always receive the mouse events using the IDirectFBWindow::GrabPointer (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabPointer.html) interface. There's a corresponding IDirectFBWindow::UngrabPointer (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabPointer.html) interface to release this relationship.

If you want to force all keyboard input to a specific window, use the IDirectFBWindow::GrabKeyboard (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabKeyboard.html) interface, and to release this relationship, use the IDirectFBWindow::UngrabKeyboard (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabKeyboard.html) interface. If you want specific keys to trigger the focus to a specific window, use the IDirectFBWindow::GrabKey (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabKey.html) interface, and to release the key, the IDirectFBWindow::UngrabKey (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabKey.html) interface.

You could force the specific focus to a window using the IDirectFBWindow::RequestsFocus (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_RequestFocus.html) interface.

If you want to create a window that is totally transparent to focus and input control, in other words will never receive focus or input events, then set the DFBWindowOptions (http://www.directfb.org/docs/DirectFB_Reference/types.html#DFBWindowOptions) flag called DWOP_GHOST using the IDirectFBWindow::SetOptions (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_SetOptions.html) interface. For example the DFBCursor is using this technique.

 
 
 

Notes:Software fallback warnings

From DirectFBWiki

Enable software fallback warnings

The run-time option "software-warn" makes DirectFB show warnings whenever a software fallback method is used.

root@embedded:~> DFBARGS=software-warn gtk-demo                                                                                                                                               
[...]                                                                                                                                                                                                                                   
(!!!)  *** WARNING [Blit          (  23, 270-   1x   8) ARGB, flags 0x00000005, color 0xff000000, source ( 123,   0) ARGB] *** [generic.c:7945 in gBlit()]

 

Use the mechanism to see all rendering operations

Adding "no-hardware" will cause software fallbacks all the time, hence showing every rendering operation made.

root@embedded:~> DFBARGS=software-warn,no-hardware gtk-demo                                                                                                                         
[...]                                                                                                                                                                                                                                  
(!!!)  *** WARNING [FillRectangle (   2, 264- 200x  20) ARGB, flags 0x00000000, color 0xffffffff] *** [generic.c:7823 in gFillRectangle()]                     
(!!!)  *** WARNING [Blit          (   0,   0- 123x   9) ARGB, flags 0x00000000, color 0x00000000, source (   0,   0) ARGB] *** [generic.c:7945 in gBlit()] 
(!!!)  *** WARNING [Blit          (  23, 270-   1x   8) ARGB, flags 0x00000005, color 0xff000000, source ( 123,   0) ARGB] *** [generic.c:7945 in gBlit()]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值