I&#39;m working with gtkmm + cairomm<br><br>I don&#39;t know if its a bug or not.<br><br>I do override the expose-event function of my window.<br>But now anything added over my window isn&#39;t rendered except drawing area that their on_expose_event is overrided too.
<br><br>it&#39;s like if the window was rendering over everything.<br><br>My main goal is to make a borderless window with rounded corner. <br>And a custom skin for the widgets.<br><br>I can use a custom skin with Gtk::RC rc(&quot;
myfile.gtkrc&quot;);<br>But my last and only problem is to make a window that doesn&#39;t render over every widget...<br>I done that with gtk+ and cairo. <br>But i don&#39;t exactly understand why in cairomm it doesn&#39;t work.
<br><br>here is what i want to do with cairomm...<br><a href="http://img54.imageshack.us/img54/6558/steambm1.png">http://img54.imageshack.us/img54/6558/steambm1.png</a><br><br>-----------------------------------CairoWindow.cc--------------------------------------------------
<br>#include &quot;cairo-window.h&quot;<br>#include &quot;cairo.h&quot;<br><br>CairoWindow::CairoWindow(){<br>&nbsp;&nbsp;&nbsp; this-&gt;on_screen_changed(this-&gt;get_screen()); <br>}<br>CairoWindow::~CairoWindow(){}<br><br>bool CairoWindow::on_expose_event(GdkEventExpose* event){
<br>&nbsp; Glib::RefPtr&lt;Gdk::Window&gt; window = get_window();<br>&nbsp; if(window)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; Gtk::Allocation allocation = get_allocation();<br>&nbsp;&nbsp;&nbsp; const int width = allocation.get_width();<br>&nbsp;&nbsp;&nbsp; const int height = allocation.get_height
();<br><br>&nbsp;&nbsp;&nbsp; Cairo::RefPtr&lt;Cairo::Context&gt; cr = window-&gt;create_cairo_context();<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cr-&gt;set_source_rgba(0.0, 0.0, 0.0, 0.0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;set_operator(Cairo::OPERATOR_SOURCE );<br>&nbsp;&nbsp;&nbsp; cr-&gt;rectangle(event-&gt;
area.x, event-&gt;area.y,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; event-&gt;area.width, event-&gt;area.height);<br><br>&nbsp;&nbsp;&nbsp; cr-&gt;clip();<br>&nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp; cr-&gt;save();<br>&nbsp;&nbsp;&nbsp; cr-&gt;paint();<br>&nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp; int distance = 10;<br>&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; cr-&gt;set_source_rgba(
0.27f, 0.27f, 0.27f,1);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cr-&gt;move_to(distance,0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(width-distance,0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(width-distance,0, width, 0, width,distance);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(width,height-distance);
<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(width,height-distance,width,height,width-distance,height);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(distance,height);<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(distance,height,0,height,0,height - distance);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(0,distance);
<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(0,distance,0,0,distance,0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;fill();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cr-&gt;set_source_rgba(0.35f, 0.42f, 0.31f,1);<br>&nbsp;&nbsp;&nbsp; cr-&gt;move_to(distance,0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(width-distance,0);<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(width-distance,0, width, 0, width,distance);
<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(width, distance * 3);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(0, distance * 3);<br>&nbsp;&nbsp;&nbsp; cr-&gt;line_to(0, distance);<br>&nbsp;&nbsp;&nbsp; cr-&gt;curve_to(0,distance, 0, 0, distance,0);<br>&nbsp;&nbsp;&nbsp; /*cairo_curve_to(cr,0, height - 5, 0, height, 5,height);
<br>&nbsp;&nbsp;&nbsp; cairo_line_to(cr,0, height);<br>&nbsp;&nbsp;&nbsp; cairo_line_to(cr,width,height);<br>&nbsp;&nbsp;&nbsp; cairo_line_to(cr,width,0);*/<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /*cairo_arc(cr, width / 2, height / 2, (width &lt; height ? width : height) / 2 - 8 , 0, 2 * 3.14
);*/<br>&nbsp;&nbsp;&nbsp; cr-&gt;fill();<br>&nbsp;&nbsp;&nbsp; cr-&gt;stroke();<br>&nbsp;&nbsp;&nbsp; cr-&gt;restore();<br>&nbsp; }<br>}<br><br>void CairoWindow::on_screen_changed( const Glib::RefPtr&lt;Gdk::Screen&gt;&amp; previous_screen ){<br>&nbsp;&nbsp;&nbsp; const Glib::RefPtr&lt;Gdk::Screen&gt; screen = this-&gt;get_screen();
<br>&nbsp;&nbsp;&nbsp; const Glib::RefPtr&lt;Gdk::Colormap&gt; colormap = screen-&gt;get_rgba_colormap();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if(colormap){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; &quot;Screen support alpha channel&quot;;<br>&nbsp;&nbsp;&nbsp; }else{<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; &quot;Screen support alpha channel&quot;;
<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; this-&gt;set_colormap(colormap);<br>};<br><br>----------------------------------------------------------------------------------------------------------<br>------------------------------------------CairoWindow.h--------------------------------------------
<br>#ifndef GTKMM_CAIRO_WINDOW_H<br>#define GTKMM_CAIRO_WINDOW_H<br><br>#include &lt;gtkmm/window.h&gt;<br>#include &lt;iostream&gt;<br><br>class CairoWindow : public Gtk::Window<br>{<br>&nbsp;&nbsp;&nbsp; public:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CairoWindow();
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual ~CairoWindow();<br><br>&nbsp;&nbsp;&nbsp; protected:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Override default signal handler:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual bool on_expose_event(GdkEventExpose* event); <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; virtual void on_screen_changed( const Glib::RefPtr&lt;Gdk::Screen&gt;&amp; previous_screen);&nbsp;&nbsp;&nbsp; 
<br>};<br><br>#endif // GTKMM_EXAMPLE_CLOCK_H<br><br>-----------------------------------------------------------------------------------------------------------<br><br>I may be missing something but i believe this is fairly simple 
<br>