1

I am working on a bit of a hobby project while trying to better understand the windowing system in Linux. I want to create a program that will constantly print the contents of the active textbox in a firefox window. I know this is possible on windows with FindWindow, but I am curious whether this could be duplicated on Linux.

I am currently running this on ubuntu, with the standard version of firefox. So far, I have been able to pull in a foreign window based on the window ID, but cannot seem to get past that. The current script simply prints out the display width of the firefox window.

    uint xlib_window = 0x00800010; //firefox window id
    gtk_init(&argc, &argv);
    GdkDisplay * gdk_display = gdk_display_get_default();
    GdkWindow * temp =     gdk_x11_window_foreign_new_for_display(gdk_display, xlib_window);
    cout << gdk_window_get_width(temp) << endl;

I would like to be able to find the current active widget, and print whatever it contains it is a text buffer. Right now, I am only able to find generic information about the window.

tmprl3467
  • 19
  • 1

0 Answers0