no keypress-events in created Gdk::Window



hello,

i used the search function but found nothing concerning my problem.

i wrote a widget for embedding "rdesktop" in my application (OS is Linux).
(took the code mostly from GtkOgre, thanks for that).
The widget creates a window, and the a forked process starts rdesktop with
the XWindow-ID of the
created Window. 

code:
creating the window in on_realize() of the Widget:
********
void GtkRDesktopWidget::on_realize()
{
	set_flags(Gtk::NO_WINDOW | Gtk::CAN_FOCUS);

   // call base class	
   Gtk::Widget::on_realize();
   if(!refGdkWindow)
   {

	   //Create the GdkWindow:
      GdkWindowAttr attributes;
      memset(&attributes, 0, sizeof(attributes));

      Gtk::Allocation allocation = get_allocation();

      //Set initial position and size of the Gdk::Window:
      int x = allocation.get_x();
      int y = allocation.get_y();
      int width = allocation.get_width();
      int height = allocation.get_height();
      
      attributes.x = x;
      attributes.y = y;
      attributes.width = 800;	
      attributes.height = 600;	      
      
      attributes.event_mask =  get_events () | Gdk::EXPOSURE_MASK |
Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK | Gdk::FOCUS_CHANGE_MASK;
      attributes.window_type = GDK_WINDOW_CHILD;
      attributes.wclass = GDK_INPUT_OUTPUT;
      
      refGdkWindow = Gdk::Window::create(get_window(), &attributes, GDK_WA_X
| GDK_WA_Y);
      refGdkWindow->set_accept_focus(true);
      
      unset_flags(Gtk::NO_WINDOW);
      set_window(refGdkWindow);
      
      set_double_buffered(false);
 
      refGdkWindow->set_user_data(gobj());
      refGdkWindow->set_back_pixmap(Glib::RefPtr<Gdk::Pixmap>(), true);  


		GdkWindow* my_gdk_window = refGdkWindow->gobj();

                // remember XWindow in membervariable
		client_window = GDK_WINDOW_XWINDOW(my_gdk_window);

   }   
		
	startRDesktop();
}

********

later starting RDesktop in a forked process:
********
        execl(rdesktop_path.c_str(), "rdesktop",
              server_opt.str().c_str(),
              "-uuser",
              "-ppassword",
              "-kde",
              size_opt.str().c_str(),
              "-D",
              window_opt.str().c_str(),
              NULL);
********

It works fine and displays the screen of the rdesktop server.
Mouseclicks are passed through, no problem.
But i can't get any keyboard-events ...

Has anybody knowledge of such a problem and a solution or even a hint?

apologize my poor english...
thanks a lot,
matt61
-- 
View this message in context: http://www.nabble.com/no-keypress-events-in-created-Gdk%3A%3AWindow-tp19451974p19451974.html
Sent from the Gtkmm mailing list archive at Nabble.com.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]