What have I done wrong?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: What have I done wrong?

Postby DJackson » Sat Jan 23, 2016 7:26 pm

Indeed that does work. On the C++ side of things could you briefly describe the minimum that I have to do to enable dragging? I've already overridden OnDragEnter (returns false always), OnDraggableRegionsChanged (which I'm not sure if I need), and CefGetDragHandler.
DJackson
Techie
 
Posts: 11
Joined: Fri Jan 22, 2016 3:48 pm

Re: What have I done wrong?

Postby magreenblatt » Sat Jan 23, 2016 7:39 pm

OnDraggableRegionsChanged is the only one you need. Look at the implementation in libcef/browser/root_window_win.cc
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: What have I done wrong?

Postby DJackson » Sun Jan 24, 2016 10:07 pm

It doesn't look like I can implement dragging just by overriding CefDragHandler::OnDraggableRegionsChanged. All it seems to do is tell me what regions should be draggable. What more do I have to do to actually implement dragging?
DJackson
Techie
 
Posts: 11
Joined: Fri Jan 22, 2016 3:48 pm

Re: What have I done wrong?

Postby DJackson » Mon Jan 25, 2016 10:21 pm

This is the function I'm finding in root_window_win.cc of cefclient. Is this the correct code to be looking at?
Code: Select all
void RootWindowWin::OnSetDraggableRegions(
    const std::vector<CefDraggableRegion>& regions) {
  REQUIRE_MAIN_THREAD();

  // Reset draggable region.
  ::SetRectRgn(draggable_region_, 0, 0, 0, 0);

  // Determine new draggable region.
  std::vector<CefDraggableRegion>::const_iterator it = regions.begin();
  for (;it != regions.end(); ++it) {
    HRGN region = ::CreateRectRgn(
        it->bounds.x, it->bounds.y,
        it->bounds.x + it->bounds.width,
        it->bounds.y + it->bounds.height);
    ::CombineRgn(
        draggable_region_, draggable_region_, region,
        it->draggable ? RGN_OR : RGN_DIFF);
    ::DeleteObject(region);
  }
DJackson
Techie
 
Posts: 11
Joined: Fri Jan 22, 2016 3:48 pm

Re: What have I done wrong?

Postby magreenblatt » Mon Jan 25, 2016 10:33 pm

Yes.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Previous

Return to Support Forum

Who is online

Users browsing this forum: cybersight, Google [Bot] and 39 guests